Android Question Get views to size correctly for different Devices

Jakes72

Member
Licensed User
Hi Everyone,

I am still learning B4A and I am struggling to get my layouts to size correctly on different devices.
When I am in the designer I set it to 'Match Chosen Variant' and under the 'Variants' tab I just have one entry which is 320 x 480, scale = 1 (160 dpi), also under Script-General I have 'AutoScaleAll', in other words I have just left it completely on the default settings. I use my phone to develop the app with using the bridge. Now when I run the app it looks fine on my phone, but not on my friends phone (some of the controls do not stretch enough across to fill the screen and leave a gap on the side), he has a Samsung J7 and I have a Xiaomi Redmi Note 2 DS. For example if I put a panel at the top of the screen and stretch it to fill in the dark gray area of the designer it will go across my phone's screen correctly, but on his phone it will leave a gap at the right and not fill the entire screen. How do I fix this problem?
 

Jakes72

Member
Licensed User
Thank you Klaus, I appreciate the help, I will try that. Now I have another question, how would I set the anchor if I was adding a view dynamically in code?
 
Top