iOS Question ScrollView is not showing entire rows

Shay

Well-Known Member
Licensed User
Longtime User
I will try to explain without video
if I use this code:
scvMain.Initialize("scvMain",100%x, 100%y)
Page1.RootPanel.AddView(scvMain, 0dip, 0dip, 100%x, 100%y)
then it will show only the rows fit the screen it will not scroll even if I put:
scvMain.ScrollEnabled = True

if I change to:
Page1.RootPanel.AddView(scvMain, 0dip, 0dip, 100%x, 90%y)
it will scroll, but I cannot see last row (especially if I put button in the space there) - I will see part of the row, if I try to scroll up, it will automatically bounce down.

I tried to play with:
scvMain.Initialize("scvMain",100%x, 100%y) - changing the %y to smaller
did not help (even worse)
 

klaus

Expert
Licensed User
Longtime User
100%x and 100%y are only known in Page1_Resize.
Where and how do you define the height of Scrollview internal Panel ?
I don't see scvMain.Panel.ContentHeight = xxx
The ScrollView will scroll only if scvMain.Panel.ContentHeight > scvMain.Height.
The same is valid for the width.
The B4i ScrollView can scroll in both directions like ScrollView2D in B4A.
 
Upvote 0

narek adonts

Well-Known Member
Licensed User
Longtime User
for exemple

B4X:
Dim ScvMain As ScrollView
    ScvMain.Initialize("ScvMain",200%x,200%y)
    ScvMain.ContentHeight=200%y
    ScvMain.ContentWidth=200%x

Change the 200%x with your size
you can change it on runtime also

ScvMain.Panel.Height=x
ScvMain.ContentHeight=x
...

Narek
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Actually it is not duplicate,
it was solved by moving to designer as you suggested on other thread
AND
changing bounce to false
 
Upvote 0
Top