Hi,
I can't seem to get my layout to work correctly in a scrollview.
I have a layout called 'Layout1' this contains a bunch of objects in a panel. This panel is 610dip in height.
I have created another layout which has a ScrollView in it (ScrollView1). This layout is called 'ScrollViewLayoutOnly'.
I have loaded the 'ScrollViewLayoutOnly' layout and then tried to load the 'Layout1' in the scrollview like:
The issue I have is it doesn't scroll, and the scrollview is at the top of the screen.
The layout isn't also 100% the width of the screen.
Anyone know where I have gone wrong ?
I can't seem to get my layout to work correctly in a scrollview.
I have a layout called 'Layout1' this contains a bunch of objects in a panel. This panel is 610dip in height.
I have created another layout which has a ScrollView in it (ScrollView1). This layout is called 'ScrollViewLayoutOnly'.
I have loaded the 'ScrollViewLayoutOnly' layout and then tried to load the 'Layout1' in the scrollview like:
B4X:
Dim nc As NavigationController
nc.Initialize("nc")
NavControl = nc
Page1.Initialize("Page1")
Dim lp As Page
lp.Initialize("lp")
lp.RootPanel.Color = Colors.Red
Dim rp As Page
rp.Initialize("rp")
rp.RootPanel.Color = Colors.Green
smc.Initialize(Null, nc, Null)
Main.app.KeyController = smc
Page1.HideBackButton = True
NavControl.SetNavigationBarVisibleAnimated(False)
Page1.RootPanel.Color = Colors.Blue
Page1.RootPanel.LoadLayout("ScrollViewLayoutOnly") ' only has a ScrollView1
ScrollView1.Panel.LoadLayout("Layout1") ' has my layout with a panel which is 610dip in height
ScrollView1.Left = 0dip
ScrollView1.Width = 100%x
ScrollView1.Height = 100%y - 50dip - 50dip
ScrollView1.Top = 50dip
' I want it 50dip from the top of screen, and 50dip from the bottom of the screen
ScrollView1.Panel.Height = 610dip
ScrollView1.Panel.Width = 100%x
nc.ShowPage(Page1)
The issue I have is it doesn't scroll, and the scrollview is at the top of the screen.
The layout isn't also 100% the width of the screen.
Anyone know where I have gone wrong ?