Erel, you've suggested starting a new thread with that, so here we go:
I have a problem loading correct layout variants. To be short, if I don't have a specific variant for the device I'm testing, the app will always pick the smallest variant I have in the layout file, like 320x480.
I don't know, may be it's by design; I searched the tutorials and posts but couldn't find any info on how b4a picks the layout variant if it cannot find a matching set.
Example: I have the following variants: 800x1280/1280x800, 600x1024/1024x600, 320x480/480x320 all in one layout file, all scale 1. When device's screen is exact match, it's fine, it picks the right layout variant. But if I load the app on 1440x900 screen, it picks 480x320 layout, though logically the best match would be 1280x800. Same thing about let's say 1280x720 (i use this size on my hardware accelerated VM simulator to capture apps' promo videos at 720p) - it picks 480x320 instead of much closer 1024x600 variant.
quoting Erel:
my answer:
They are all scale 1 as you suggested in your tutorial. I'm not at my location, so I cannot upload the layouts, but they are nothing special and they work fine. In most cases i just AutoScaleAll and center the elements or specify the background size, like element.width = 100%x etc. The layouts work fine, that's not a problem. The problem is it's not clear (to me) how B4A chooses the variants when loading the layout. I've tried to find the answer in your tutorials and other tutorials but couldn't, may be I'm overlooking something.
I really need different layouts for phones versus tablets, so I cannot just use one layout and autoscale it then move the elements around a bit for different screens. I would also prefer to have it all in one layout file with variants, not creating different layout files for phones and tablets and then check the screen size in the script and load different layouts based on the device's screen size. Please advise.
(Your Layout Designer is great and helps me a lot with my projects. Thank you.)
I have a problem loading correct layout variants. To be short, if I don't have a specific variant for the device I'm testing, the app will always pick the smallest variant I have in the layout file, like 320x480.
I don't know, may be it's by design; I searched the tutorials and posts but couldn't find any info on how b4a picks the layout variant if it cannot find a matching set.
Example: I have the following variants: 800x1280/1280x800, 600x1024/1024x600, 320x480/480x320 all in one layout file, all scale 1. When device's screen is exact match, it's fine, it picks the right layout variant. But if I load the app on 1440x900 screen, it picks 480x320 layout, though logically the best match would be 1280x800. Same thing about let's say 1280x720 (i use this size on my hardware accelerated VM simulator to capture apps' promo videos at 720p) - it picks 480x320 instead of much closer 1024x600 variant.
quoting Erel:
The variants you wrote have no meaning without the scale value.
my answer:
They are all scale 1 as you suggested in your tutorial. I'm not at my location, so I cannot upload the layouts, but they are nothing special and they work fine. In most cases i just AutoScaleAll and center the elements or specify the background size, like element.width = 100%x etc. The layouts work fine, that's not a problem. The problem is it's not clear (to me) how B4A chooses the variants when loading the layout. I've tried to find the answer in your tutorials and other tutorials but couldn't, may be I'm overlooking something.
I really need different layouts for phones versus tablets, so I cannot just use one layout and autoscale it then move the elements around a bit for different screens. I would also prefer to have it all in one layout file with variants, not creating different layout files for phones and tablets and then check the screen size in the script and load different layouts based on the device's screen size. Please advise.
(Your Layout Designer is great and helps me a lot with my projects. Thank you.)