I'm looking for some guidance on layout best practices when it comes to designing for multiple screen sizes. Specifically how to design for and manage things like bitmap scaling verses margin, etc.
I've read Google's Android reference on screen size, pixel density, etc - I'm looking for something with more practical examples and strategies.
Just some tips:
- You can create several 'variants' for your layout with the designer: http://www.b4x.com/forum/basic4andr...2-guess-my-number-visual-designer-events.html
- When you call Activity.LoadLayout the most suitable variant is loaded.
This method also returns a LayoutValues object which holds the values of the loaded variant.
You can call GetDeviceLayoutValues to find the current device layout values:
B4X:
Dim lv As LayoutValues
lv = Activity.LoadLayout("1") 'layout values of the loaded variant
lv = GetDeviceLayoutValues 'Current device layout values.
- Use dip units for "pixels length". For example: Button1.Width = 100dip
- You can also use %x and %y units.