How to close a ScrollView

volvomann

Active Member
Licensed User
Longtime User
Hallo I use an srolwievlist that I activate with a button, but i dont find out the that will close it, Will any one tell med how to :)
 

volvomann

Active Member
Licensed User
Longtime User
I use this code to activate it, Another quistion: how to chang ebac.color for the list? ( i want a button to close/ hide the list)
Sub mnuPage4_Click
ScrollView1.Initialize(0)
pnl = ScrollView1.Panel
Activity.AddView(ScrollView1, 0, 0, 100%x, 100%y)
lstChecks.Initialize
For i = 1 To 100
chk.Initialize("")
chk.Text = "Item #" & i
lstChecks.Add(chk)
lbl1.Initialize("")
lbl1.Text = "Value #" & i
lbl1.Gravity = Gravity.CENTER_VERTICAL
pnl.AddView(chk, 0, height * (i - 1), 120dip, height)
pnl.AddView(lbl1, 125dip, height * (i - 1), 120dip, height)
Next
pnl.height = lstChecks.Size * height
Activity.AddMenuItem("Display checked", "mnuChecked")

End Sub
 
Upvote 0

William Hunter

Active Member
Licensed User
Longtime User
Hallo I use an srolwievlist that I activate with a button, but i dont find out the that will close it, Will any one tell med how to :)
If you want to clear the ScrollView try this. The Call would be: ClearScrollView(the name of your ScrollView goes here).
B4X:
Sub ClearScrollView(SV As ScrollView)
   For i = SV.Panel.NumberOfViews - 1 To 0 Step -1
      SV.Panel.GetView(i).RemoveView
   Next
End Sub
 
Upvote 0
Top