Sub Globals
Dim scvMain As ScrollView
Dim PanelTop as Panel [COLOR="SeaGreen"]' A panel created in the "ScrollViewPanels" layout.[/COLOR]
Dim PanelMid As Panel [COLOR="SeaGreen"]' A panel created in the "ScrollViewPanels" layout.[/COLOR]
Dim PanelBottom As Panel [COLOR="SeaGreen"]' A panel created in the "ScrollViewPanels" layout.[/COLOR]
End Sub
[COLOR="SeaGreen"]' Call this sub to initialize the view rather than a simple activity.LoadLayout ("ScrollViewPanels").[/COLOR]
Sub InitScrollingView
Dim Panel0 As Panel
scvMain.Initialize (1180dip) [COLOR="SeaGreen"]' Determine appropriate height of scrolling area
' Note this number needs to be tweaked depending on your height requirements![/COLOR]
Activity.AddView(scvMain,0,0,100%x,100%y)
Panel0=scvMain.Panel
Panel0.Color=Colors.Black
panel0.LoadLayout ("ScrollViewPanels") [COLOR="SeaGreen"]' contains PanelTop, PanelMid and PanelBottom[/COLOR]
[COLOR="SeaGreen"]' Fix the coordinates since we don't really know how we left it when working on it in the designer....[/COLOR]
PanelTop.Top = 0
PanelTop.Left = 0:PanelTop.Width = Panel0.Width
PanelMid.Top = PanelTop.Top + PanelTop.Height + 10[COLOR="SeaGreen"] ' Set mid panel 10 pix below bottom of TOP panel[/COLOR]
PanelMid.Left = 0:PanelMid.Width = Panel0.Width
PanelBottom.Top = PanelMid.Top + panelMid.Height + 10[COLOR=SeaGreen] ' Set mid panel 10 pix below bottom of TOP panel[/COLOR]
PanelBottom.Left = 0:PanelBottom.Width = Panel0.Width
End Sub