Hi community I'm having problems with the click event management of a button on a panel added to the scrollview. I am trying to program the event of the button to make a panel visible outside the scrollview, I am a beginner with the scrollview be patient. Could someone post an example?
B4X:
Sub Globals
Private Panel2 as Panel
dim NrItem As List
dim Panel1 As Panel
dim BtItem1 As button
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
NrItem=2
CreateAddView
End sub
Sub CreateAddView
Dim i As Int
For i=0 To NrItem-1
panel1.Initialize("")
panel1.SetLayout(0%x,0%x,100%x,100%x)
BtItem1.Initialize("")
BtItem1.Text="Item"&i
BtItem1.Tag=i
panel1.AddView(BtItem1,1%x,1%x,27%x,HorizontalScrollViewItem.Height-2%x)
HorizontalScrollViewItem.Panel1.AddView(panel,0%x,0%x,320%x,HorizontalScrollViewItem.Height)
Next
HorizontalScrollViewItem.Panel.Width=(NrItem)*(40%x)
End Sub
B4X:
Sub BtItem1_Click
Panel2.visible=true 'does not work!
End Sub