Android Question Anchor relation with relative positions

jboavida

Member
Licensed User
Hi,
Sorry if this question is already asked, but I cannot find it.
I have a question regardind how anchors work.
I have learned from my little experience with B4A that the best way to make a layout look good in different screens is to use percent coordinates, like Button1.Left=42%x

I found ou that using that Button1.Left or Button1.Right, is not the same, even if I position the button in the same relative positions.

Is this related with achors? Example, if the a button as left anchor, should be positioned using the Button.Left property?

Becuase a button that as horizontal anchor to the left using the Left property or the Right property does no yield the same results... I some devices the button is proprely positioned and in others no. If I use the Left property all works well, but if I use the right property the results are not the same.

Thanks in advance
Joaquim
 

Erel

Administrator
Staff member
Licensed User
like Button1.Left=42%x
Looks like a mistake.

I found ou that using that Button1.Left or Button1.Right, is not the same, even if I position the button in the same relative positions.

Is this related with achors? Example, if the a button as left anchor, should be positioned using the Button.Left property?
Anchors are applied before the designer script is executed. The designer script will override the anchors effect.
 
Top