Is this possible to layout screen programatically

aymk

Member
Licensed User
Longtime User
Does anyone know if it is possible to layout a screen programmatically with 4 columns, 1st & 3rd columns consist of textbox with a width of 10% and 2nd and 4th columns consist of label with width of 40%, some rows may contain only 2 columns of label with the width of 50% each. The # of rows is depended on the orientation of the device. Please advise.

Thanks.
 

aymk

Member
Licensed User
Longtime User
Hi Erel,

I am new to Basic4Android, can you give some pointers where to look for some sample codes on creating label and textbox programatically.

Thanks.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Addin Views programatically uses these steps:

Declare the view
Create the view
Add it to the activity...

Example:

In Globals:
Dim Label1, Label2, Label3 As Label

In Activity_Create:
Label1.Initialize("") 'No event to monitor
Label2.Initialize("") 'No event to monitor
Label2.Initialize("") 'No event to monitor

Activity.AddView(Label1,20,20,50,200)
Activity.AddView(Label2,70,20,50,200)
Activity.AddView(Label3,120,20,50,200)

We now have 3 empty Labels, ready to receive text using Label1.Text = "Anyting you need"
 
Upvote 0
Top