Hi folks.
I am trying to create multiple labels programmatically and i would like to use a label created in the designer as a pattern.
Is there a way to assign the existing properties from the label of the designer to all created labels in the code?
Thanks so much.
Here is the code I am using so far:
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
For i = 0 To 25
Dim Labelx As Label
Labelx.Initialize("Label")
Labelx.Color = Colors.Blue
Labelx.Text = i
Labelx.Tag =i
Root.AddView(Labelx, 10dip, 100dip, 30dip, 30dip)
Labelx.Left = i*45dip
Next
End Sub[
/CODE]
Create a second layout file with the label you want to reuse. Then, in your 'For' loop, create panels instead of labels, and load that layout into the panel.