Multiple device

omoba

Active Member
Licensed User
Longtime User
Hi,

Pls I have read threads on fitting apps for multiple devices and I have always used the %x and %y becos I understood it easier (dip I couldn't just get it)

For some reason I can't get this app to fit right on multiple device correctly. I have 2 different mobile phone sizes and a 7in tablet.

Pls can someone help me with it and maybe add some comments so I can learn from my mistake/shortcomings.

I dont mind scaling using dip or %x/%y. Just pls put some comments so I can understand.

I have attached app (bal and b4a files)
Thanks
 
Last edited:

JonPM

Well-Known Member
Licensed User
Longtime User
Can you post specific pictures of where you are having problems on each device? It is too difficult to try to use your code because I don't have a certain library your are using, and also you did not include the image files needed for the layouts.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I started with this code (I've removed the ImageView and set the image as the activity background)
B4X:
AutoScaleAll 'uncomment to scale all views based on the device physical size.
Label2.HorizontalCenter = 50%x

Label1.SetLeftAndRight(0, 50%x)
Label3.SetLeftAndRight(50%x, 100%x)
scvText.SetLeftAndRight(0, 100%x)
scvText.SetTopAndBottom(Label1.Bottom, 100%y)
However your background image is hard to work with. you should break it into two images. One with only the border and the other with the title.

This will make it much easier to put the label in the image.
 
Upvote 0
Top