Could we have some more examples please

IanMc

Well-Known Member
Licensed User
Longtime User
For example say I have a square panel in the middle of the screen with some views on it, in portrait mode it would be nice to have say three buttons on the top and three on the bottom that align themselves above and below the square panel but in landscape mode these buttons would best be aligned to the sides.

Also Labels seem to have a mind of their own when I place a label on my panel and then view it in the UI Cloud then sometimes these labels show off and (usually) top left above the panel, sometimes they don't show at all.

Are there any particular tricks to using labels in designer scripts?
 

IanMc

Well-Known Member
Licensed User
Longtime User
Ah, ok, anyway I seem to have the labels behaving themselves at the moment
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I believe I read that 2.30 support if statements in the designer script, didn't test it myself but you could try something like

B4X:
if 100%x>100%y then
 label1.top=main.top
 label2.top=main.top
 label3.top=main.top
 label1.right=main.left-1
 label2.right=label1.left-1
 label3.right=label2.left-1
else
 label1.bottom=main.top
 label2.bottom=main.top
 label3.bottom=main.top
 label1.left=main.horizontalcenter-(label2.width/2)
 label2.left=main.horizontalcenter
 label3.left=main.horizontalcenter+(label2.width/2)
end if
 
Upvote 0

IanMc

Well-Known Member
Licensed User
Longtime User
Yes cool, this is something similar to the About screen example.

This may be the way to go for me.

Thanks!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…