JonPM Well-Known Member Licensed User Longtime User Dec 9, 2015 #1 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? Attachments scvtest.zip scvtest.zip 3.3 KB · Views: 607
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?
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2015 #2 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: Code: Copy 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. Upvote 0
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: Code: Copy 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.
JonPM Well-Known Member Licensed User Longtime User Dec 9, 2015 #3 Thanks Erel. Will my project in the first post work as is once the bug is corrected in the next version? Upvote 0
Thanks Erel. Will my project in the first post work as is once the bug is corrected in the next version?
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2015 #4 No. You should use anchors to set the size of Panel1. Otherwise you need to guess the additional height required based on the device screen size. Upvote 0
No. You should use anchors to set the size of Panel1. Otherwise you need to guess the additional height required based on the device screen size.
JonPM Well-Known Member Licensed User Longtime User Dec 9, 2015 #5 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? Upvote 0
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?
Erel B4X founder Staff member Licensed User Longtime User Dec 10, 2015 #6 JonPM said: The problem with using anchors on Panel1 is that the ContentHeight of the scrollview determines Panel1's height, which is backward Click to expand... This is still the correct solution. It is always the parent that sets the child views height. Upvote 0
JonPM said: The problem with using anchors on Panel1 is that the ContentHeight of the scrollview determines Panel1's height, which is backward Click to expand... This is still the correct solution. It is always the parent that sets the child views height.