Android Question B4A - BETA - Designer question

NJDude

Expert
Licensed User
Longtime User
When using anchors the results are a little confusing, the attached project contains a sample, pay attention to BUTTON1 and LABEL1, when changing orientations the sizes of those 2 views are completely different, my question is, what's the correct behavior if I decided to so something like that?
 

Attachments

  • BETA3_DesignerTest.zip
    6.9 KB · Views: 242

LucaMs

Expert
Licensed User
Longtime User
When using anchors the results are a little confusing, the attached project contains a sample, pay attention to BUTTON1 and LABEL1, when changing orientations the sizes of those 2 views are completely different, my question is, what's the correct behavior if I decided to so something like that?

Please, post the screenshots too (i haven't the new Designer).

I don't know if this has already been asked, it is coming in my mind at this time:
but Anchor is useful in a mobile device? Usually it is used when you maximize the container.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
SS-2014-01-07_20.29.12.png


The vertical anchor is "incorrect" in this case. Setting it to BOTH means that the distances to the screen (parent actually) top edge and bottom edge are constant. In this case the distance to the bottom is very high. So when you change the orientation the height will actually be negative...

You do not need to run the program to see it. You can change the abstract designer layout.

You should use BOTH when you want to fill the available area.
Good usage of BOTH:
SS-2014-01-07_20.33.57.png


Changing orientation:
SS-2014-01-07_20.34.27.png



but Anchor is useful in a mobile device?
Yes. You want your layout to be flexible and scale correctly on all devices.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
but Anchor is useful in a mobile device?


Yes. You want your layout to be flexible and scale correctly on all devices.

You're absolutely right.

In addition, it is what I tried to achieve for several days, long time ago, when I was struggling using autoscale(s)
 
Upvote 0
Top