B4J Question Designer - how to change "something" if...

LucaMs

Expert
Licensed User
Longtime User
Just for "curiosity" I wanted to know if the "Designer script interpreter" would have accepted this kind of line (the first one):
B4X:
If %x < 250dip Then
    ' Change Button1 orientation,
    ' from horizontal to vertical.
    ' --- code here
End If
This because percentages are related to the container in which I will load the layout.

Well, the script interpreter does not "digest" that %x (alone).

That's all, I wanted to test just this. Then I wanted to solve this kind of "problem": how to change "something" (Button1 orientation, in this case) when one side of the container "reaches" a wanted and fixed value (250dip, there).

I've come up with something and this works:
https://www.b4x.com/android/forum/threads/domanda-per-programmatori.117031/post-734801
I added an invisible Label, horizontally anchored to the variant edges, "to measure" the container width and used its Width property.
but... how would you do it? (Quiz šŸ˜„).



How can I refer to the layout container in the script?
 
Last edited:
Top