As I wrote in the post mentioned above Basic4android does scale layouts automatically.
However developers are sometimes confused with the meaning of auto scale. Auto scale means that the layout is scaled based on the screen DPI - dots per inch. The ratio between the height and the width always stays the same. So if one device is longer than the other there will be an empty space at the bottom.
The same layout can be used for a device with HVGA device with 320*480 (160DPI = 1.0) and WVGA device with 480*800 (240DPI = 1.5). Though you will have some empty space at the bottom.
It shouldn't be difficult to create layout variants for many types of screens.
- Create emulators with the required screen resolutions.
- Design the first layout with the regular settings.
- Add layout variants for each target resolution. Connect to the matching emulator and move the views as required.
- If you later add a new view you will need to set its position in all variants. Therefore it is recommended to first create the "main" layout and only then add the variants.
Whats the command to get the screen height and screen width of the device that the codes running on?
does canvas1.height return the value? (just a guess?)
Dim layoutVal As LayoutValues
layoutVal=GetDeviceLayoutValues
If layoutVal.width < 320 Then
splashPanel.SetBackgroundImage(LoadBitmap(File.DirAssets,"notsupported.png"))
Activity.AddView(splashPanel, 0, 0, 100%x, 100%y)
Return True
End If