Android Question ScrollViews and layouts - Beginners question

henrywood

Active Member
Licensed User
Longtime User
Hi !

I am trying to use a scrollview with a fixed/sticky layout at the top and bottom

I am using this code:

B4X:
  Activity.LoadLayout("page_general")
   topPanel.LoadLayout("topbar")
   bottomPanel.LoadLayout("bottombar")
   ScrollView1.Height = 100%y - bottomPanel.Height - topPanel.Height
   ScrollView1.Panel.LoadLayout("Signout")
   ScrollView1.Panel.Height = 100%y - bottomPanel.Height - topPanel.Height

My "page_general" layout is attached.

What I want to accomplish is that the scrollview is of course scrollable for the full height of the "Signout" layout (or any other layyout that is loaded into the ScrollView1.Panel - and these layouts will vary in height). Is this accomplished by the code above ?

Since I am using AutoScaleAll in Designer scripts in all layouts, will all controls be scaled proportionally automatically ? (in the designer it would appear that each control has a fixed height or width - say a height of 50px and a width of 320px)
 

Attachments

  • Unavngivet.png
    Unavngivet.png
    9.5 KB · Views: 299
Last edited:

eurojam

Well-Known Member
Licensed User
Longtime User
I would say, that with your code the scrollview will not be scrollable because the inner height is the same like the "outer" height of the scrollbar.
with
B4X:
ScrollView1.Panel.Height
you define the inner height, if it will be greater then the scrollbar height, the scrollbar scrolls....
May be the b4a experts will have more details on this...;)
 
Upvote 0
Top