Hello to everyone,
I've read a layout on a panel.
The layout includes some labels that I have not stated in the activity.
Sample Code like this
Sub Activity_Create(FirstTime As Boolean)
' Load the main layout for activity
Activity.LoadLayout("1")
' Load the Layout ( 1 Panel and inside 4 labels in horizontal alignment )
' Each Label has same TAG name
Dim xui as XUI
Dim p as B4XView = xui.CreatePanel("MyEventName")
p.SetLayoutAnimated(0, 0, 0, 100%x, 100%y)
p.LoadLayout("layout_with_4Labels")
' This panel host the view of layout
Dim ViewPanel as panel
ViewPanel.Initiliaze("ViewPanel")
ViewPanel.AddView(p, 0, 0, 100%x, 100%y)
End Sub
Now : How can I control the click event without stating all the Labels?
Like this
Sub Label_Click
log(Label.Text & " - " & Label.Tag)
End Sub
Can anyone help me ....
Thanks
I've read a layout on a panel.
The layout includes some labels that I have not stated in the activity.
Sample Code like this
Sub Activity_Create(FirstTime As Boolean)
' Load the main layout for activity
Activity.LoadLayout("1")
' Load the Layout ( 1 Panel and inside 4 labels in horizontal alignment )
' Each Label has same TAG name
Dim xui as XUI
Dim p as B4XView = xui.CreatePanel("MyEventName")
p.SetLayoutAnimated(0, 0, 0, 100%x, 100%y)
p.LoadLayout("layout_with_4Labels")
' This panel host the view of layout
Dim ViewPanel as panel
ViewPanel.Initiliaze("ViewPanel")
ViewPanel.AddView(p, 0, 0, 100%x, 100%y)
End Sub
Now : How can I control the click event without stating all the Labels?
Like this
Sub Label_Click
log(Label.Text & " - " & Label.Tag)
End Sub
Can anyone help me ....
Thanks