dynamic/relative layouts?

corwin42

Expert
Licensed User
Longtime User
Hi,

I was very busy in the past but now I started to have a closer look at B4A. I'm just working through the tutorials and as it was with B4PPC, B4A is really great and simple to work with.

The designer is really great but the layouts are very static. Is it possible to create dynamic/relative layouts? A Button which fills the screen width etc.?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
A Button which fills the screen width etc.?
You will need to do it programmatically. You can use the percentage units for this:
B4X:
Dim Button1 As Button
Button1.Initialize("Button1")
Activity.AddView(Button1, 25%x, 25%y, 50%x, 50%y) 'creates a button quarter of the screen size and in the middle
 
Upvote 0

GaNdAlF89

Active Member
Licensed User
Longtime User
How can I do to calculate the correct text size of label and edit text?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…