scrollview not scrolling

jimseng

Active Member
Licensed User
Longtime User
Hi. I have just purchased basic for Android and I appologize for being such a newb but I am having trouble getting a scrollview to scroll.

I am trying to combine the sliding panels example with a list with checkboxes.
Basically I am trying to add a scrollview to one of the panels and I can acheive most of it but I just can't get the list to scroll. I feel I am so close but I must have fundementally mis-understood something. Here is the code: (Combined from 2 examples on this forum)


For i = 0 To panels.Length - 1
panels(i).Initialize("panels")
panels(i).Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
Activity.AddView(panels(i), 100%x, 0, 100%x, 100%y - 60dip) 'add the panel to the layout
Activity.AddMenuItem("Panel #" & i, "Menu")
Next
scrollview1.Initialize(0)
Dim panl As Panel
panl = scrollview1.Panel
panl.Initialize("")
panels(0).LoadLayout("jabbit")
panels(1).LoadLayout("artlyt")
panels(2).AddView(panl, 100%x, 0, 100%x, 100%y - 60dip)
lstChecks.Initialize
For i = 1 To 100
Dim chk As CheckBox
chk.Initialize("")
chk.Text = "Item #" & i
lstChecks.Add(chk)
Dim lbl1 As Label
lbl1.Initialize("")
lbl1.Text = "Value #" & i
lbl1.Gravity = Gravity.CENTER_VERTICAL
panels(2).AddView(chk, 0, height * (i - 1), 120dip, height)
Next

My 3rd panel (panel(2)) shows 7 items and no more and won't scroll. It is starting to frustrate me after a couple of hours.

Cheers
 

jimseng

Active Member
Licensed User
Longtime User
Hi Klaus.
Thank for the response. I wonder if you could point me in the right direction to see if I can work it out. I have, in fact succeeded by using a layout and putting a scrollview on that and loading the layout instead of panels(2).AddView(panl, 100%x, 0, 100%x, 100%y - 60dip) but I am frustrated that I have not been able to get the version posted here to work and I want to lear why.
But yes, I am sure I can upload a zip file if you think that would be better, just after I have stripped out all the other ebarrasing code!

Regards.
 
Upvote 0
Top