Android Question B4a Visual Designer - Meaning of Variants

chrjak

Active Member
Licensed User
Longtime User
Hey,

After using it for years i still feel like i did not come behind the functionality of the visual designer variants.

Until now i only used it for Tablet/Smartphone Layout using the standard scale values (e.g. 320x480 - 1) and used designer script and anchors to let it look like i want it to look on my phone with a different scale.

I've been now wondering if i rather should use directly the scale of my phone (downscaled to 1). If this was easier for me to create and move objects to the right place and if this will optimize the layout on different scales if once set nearly perfectly on my correct scale which i see on my phone.

Or would it be the same by using the standart values scales?

I also often had some problems with AutoScaleAll as some parts moved where i didn't expect them to move. If I understood correctly the only sense of AutoScale is making Buttons bigger (or smaller?) if the phone is physically bigger or has a bigger scale (more than just 1) in order to make the layout look more harmonic instead of having like mini buttons on a huge screen.
Maybe my Problems with using AutoScale are because of the point that i haven't fully understood the variants and how they work on my phone when designing with the connected b4a app and the visual designer on pc.

I would be happy if someone could help me clearing my view on this topic
Thanks

Best Regards
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Until now i only used it for Tablet/Smartphone Layout using the standard scale values (e.g. 320x480 - 1) and used designer script and anchors to let it look like i want it to look on my phone with a different scale.
This is the correct approach.

Or would it be the same by using the standart values scales?
Don't try to create a variant for any specific device. Use as few as possible variants.

I also often had some problems with AutoScaleAll as some parts moved where i didn't expect them to move.
1. Make sure that the views are anchored correctly. Otherwise they will be resized and repositioned incorrectly.
2. Don't "fight" with AutoScale. If it doesn't do what you expect or want then don't use it. Anchors and designer script are much more important.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…