Android Question Auto Scale Scrollview Error

universengo

Member
Hello Everyone!
I'm a newbie B4A. Please help me.
I Create a lay out with two labels and one Scrollview. Two labels have the same height (40dip). I set one at the top and the last one at the bottom. The scrollview is middle of two labels. I use script general code as below:

B4X:
'All variants script
'Set up FakeActionBar
lbl_Main_FakeActionBar.Height=40dip
'Set up lblCopyright
lbl_CopyRight.Height=lbl_Main_FakeActionBar.Height
'Setup ScvMain
ScvMain.Left=0
ScvMain.Top=lbl_Main_FakeActionBar.Height
ScvMain.Width=100%x
ScvMain.Height=100%y-lbl_Main_FakeActionBar.Height-lbl_CopyRight.Height


------------------------------------------------------------------------
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private lbl_Main_FakeActionBar As Label
    Private scvMain As ScrollView
    Private lbl_CopyRight As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("lot_Main")   ' Loads "Main" layout file
End Sub
------------------------------------------------------------------------
I use Samsung J7 Pro (1080x1920, scale = 3)

When i see in Abstract Designer, the Scrollview is full height middle of two labels.
But It is not full in my smartphone. It has a gap. I don't know how to repair this error.
Please help me.
 

Attachments

  • lot_main.bal
    2.8 KB · Views: 309
  • Pic1.jpg
    Pic1.jpg
    8.3 KB · Views: 340
  • pic2.jpg
    pic2.jpg
    9.1 KB · Views: 301
  • Screenshot_20180314-164812.png
    Screenshot_20180314-164812.png
    31.8 KB · Views: 328
Last edited:

klaus

Expert
Licensed User
Longtime User
You must be avare that you need to adapt the inner Panel height to the content you add to the internal Panel.
The suggestion to set it to 2000 was just to show the problem.
You must set the height of the inner Paneto the bottom position with a small space of the most lowest object in the scrollview panel.
 
Upvote 0

universengo

Member
You must be avare that you need to adapt the inner Panel height to the content you add to the internal Panel.
The suggestion to set it to 2000 was just to show the problem.
You must set the height of the inner Paneto the bottom position with a small space of the most lowest object in the scrollview panel.
OK, Mr.Klaus. Thank you for your support.
 
Upvote 0
Top