Android Question Scrollview Height and inner layout height

cristian petersen

Member
Licensed User
Longtime User
Hello,

B4a 8.5

I am clearly not able to understand how to manage the height of the inner layout loaded in a scrollview.
In this small project I have a first layout tabstrip and added a layout (1) then a scrollview and load the same layout (1). the Label2 i set to bottom = 100%y, in Tabstrip is at the bottom of the screen ,in the scrollview the label2 is at + - 75% of the screen.
I tried to understand related posts without any luck.
Any help to understand would be appreciate.
TIA
 

Attachments

  • example.zip
    18.2 KB · Views: 170

cristian petersen

Member
Licensed User
Longtime User
Here is the project with missing directory.
The same result happends using samsung S8 o emulator Android 7 6" screen 480 x 854
 

Attachments

  • example.zip
    19.3 KB · Views: 202
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached you find a modified version of your project.

Several problems:
- Use anchors as much as possible.
- Don't use the DesignerScript to confirm the anchors!
- The problem with the position in the ScrollView is that you set, in the Designer, it's height to 500 !!!??? Why ?
 

Attachments

  • exampleNew.zip
    17.9 KB · Views: 200
Upvote 0

cristian petersen

Member
Licensed User
Longtime User
Thank you for your help Klaus.

Your recomendations are really welcome!!
A clarification: "Use anchors as much as possible" OK.
But it is OK also to set anchors between objects in DesignerScript right?
button2.left = button1.right + 12dip​

Thanks again
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
But it is OK also to set anchors between objects in DesignerScript right?
button2.left = button1.right + 12dip
Yes, but this is not an anchor, this is 'fine tuning'.

As an example, you had in the DesignerSrcipt:
ScrollView1.SetLeftAndRight(0,100%x)
And you set the horizontal anchor of ScrollView1 to Both, which is the same !?
 
Upvote 0
Top