I'm having some frustrations using AutoScaleAll in the Designer along with a scrollview. Please see attached example.
I would like the views on layout2 to AutoScale, however the size of Scrollview1.ContentHeight is incorrect in the pg resize event, causing the panel to be cut off.
Commenting out AutoScaleAll in layout2 will load the correct height, but obviously views aren't scaled.
How do you use a layout with autoscale and scrollview together?
The correct way to implement it is with a tall variant and a panel that is anchored to both sides:
The code in Page_Resize:
B4X:
Private Sub Page1_Resize(Width As Int, Height As Int)
ScrollView1.ContentWidth = Width
ScrollView1.ContentHeight = 800 'set the content to be whatever size you like. The anchors will take care of handling the panel size.
End Sub
While going over your project I found a bug in AutoScaleAll related to large containers. For now it is better not to use AutoScaleAll in the second layout. This bug is fixed for the next version.
The problem with using anchors on Panel1 is that the ContentHeight of the scrollview determines Panel1's height, which is backward. I have a fixed height for Panel1, that then gets autoscaled. Now I want the ContentHeight to be set to Panel1's new height. I'm not having luck achieving this. Advice?