T TestMyChess Member Licensed User Longtime User Feb 20, 2013 #1 I've searched the docs long and hard for this as I'm sure I'm missing something obvious. I want to position some views differently based on the orientation. I started with two layout files - portrait and landscape - which worked fine. I then saw a comment by Erel that this was unnecessary, so I tried to do it with a single layout file. But I can't work out what the designer script equivalent of Code: Copy If Activity.Width > Activity.Height Then is. :BangHead: John
I've searched the docs long and hard for this as I'm sure I'm missing something obvious. I want to position some views differently based on the orientation. I started with two layout files - portrait and landscape - which worked fine. I then saw a comment by Erel that this was unnecessary, so I tried to do it with a single layout file. But I can't work out what the designer script equivalent of Code: Copy If Activity.Width > Activity.Height Then is. :BangHead: John
Erel B4X founder Staff member Licensed User Longtime User Feb 20, 2013 #2 Here: Code: Copy If 100%x > 100%y Then Upvote 0
T TestMyChess Member Licensed User Longtime User Feb 20, 2013 #3 Thanks, Erel. That was the first thing I tried, but I must have got the syntax wrong somewhere, since I got an error message and started trying other things. Sigh. John Upvote 0
Thanks, Erel. That was the first thing I tried, but I must have got the syntax wrong somewhere, since I got an error message and started trying other things. Sigh. John
T tecevit Member Licensed User Longtime User Feb 20, 2013 #4 Hi, This worked for me : If 100%x > 100%y Then Label1.Top = 0%y Else Label1.Bottom = 100%y End If In Landscape mode, Label1 is at the top, in portrait mode, at the bottom. Upvote 0
Hi, This worked for me : If 100%x > 100%y Then Label1.Top = 0%y Else Label1.Bottom = 100%y End If In Landscape mode, Label1 is at the top, in portrait mode, at the bottom.