I don't really understand why this code doesn't work. I've got a long layout but instead of making it scrolable it seems like it instead streches it out.
B4X:
Private Sub ReportsPage_Resize(Width As Int, Height As Int)
ScrollViewMain.Panel.LoadLayout("reports")
ScrollViewMain.ContentWidth= Width
'
ScrollViewMain.ContentHeight= pnlReports2.Height
End Sub
1. Loading a layout inside the resize event can be risky. Don't assume that it will be called once.
It is also not needed if you build the layout correctly with the designer.
2. I guess that pnlReports2 is a view from the reports layout. You should make it vertically anchored to both sides and set ScrollViewMain.ContentHeight based on the height you like it to be. It is always the container that sets the sizes of the inner views.
Public Sub Show
If ReportsPage.IsInitialized = False Then
ReportsPage.Initialize("ReportsPage")
ReportsPage.RootPanel.Color = Colors.White
ReportsPage.RootPanel.LoadLayout("mainreports")
End If
Main.NavControl.NavigationBarVisible = False
Main.NavControl.ToolBarVisible = False
Main.NavControl.ShowPage(ReportsPage)
ScrollViewMain.Panel.LoadLayout("reports")
End Sub
B4X:
Private Sub ReportsPage_Resize(Width As Int, Height As Int)
ScrollViewMain.ContentWidth= Width
'
ScrollViewMain.ContentHeight= pnlReports2.Height
End Sub
@Erel I'm tired trying to make this work for 4 days now. I've uploaded a test project to reproduce this issue. It's like the layout stops loading at 100%y. I don't really understand this. My Layout is Correctly written with Designer Scrips.