Android Question Automatic panel scroll up

harinder

Active Member
Licensed User
Longtime User
I have a panel layout with a number of views loaded onto a scrollview2D panel. How can I effect the panel to shift up automatically by say 50dip on pressing a swiftbutton to make another hidden view below visible? Thanks
 

harinder

Active Member
Licensed User
Longtime User
I used the normal scrollview(not scrollview2D)
B4X:
scrollview.scrollposition=50dip
which works well.
 
Upvote 0

harinder

Active Member
Licensed User
Longtime User
Hello LucasMs..that seems to be a class based on a swipe..im looking for a simple solution without adding a class module..

Note that you can still use ScrollView2D, its properties:
HorizontalScrollPosition
VerticalScrollPosition
How did I miss that? ?
A noob question though..what distinct advantage does sv2d have over the simple sv? Thanks
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
what distinct advantage does sv2d have over the simple sv? Thanks
The scroll direction, just one using ScrollView (vertical), both vertical and horizontal "simultaneously" (I mean that with ScrollView2D you cannot swipe horizontally perfectly nor vertically, choosing how when you want/need, it's a free movement.
Also, HorizontalScrollView exists too.
 
Upvote 0

harinder

Active Member
Licensed User
Longtime User
I am not able to implement horizontal sv on sv2D, though I have changed properties of both sv2d and loaded panel to 150%x in the Designer
 
Upvote 0

harinder

Active Member
Licensed User
Longtime User
Klaus, your post
B4X:
scrollview2D.verticalscrollposition=scrollview2D.verticalscrollposition+50dip
Worked perfectly. Wondering why you deleted your post:rolleyes:
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Because I reread your post and misunderstood it and thought that the answer was wrong.
You could also use:
Scrollview2D.SmoothScrollTo(Scrollview2D.HorizontalScrollPosition, Scrollview2D.VerticalScrollPosition + 50dip)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
But I am able to scroll only vertically despite sv2D as per my post #7
It's simple...

ScrollView internal panel can be moved vertically only, by code or using your finger ?;
HorizontalScrollView internal panel... the same but horizontally;
ScrollView2D: by code, you can choose whether to move its internal panel hor or ver, using your finger you can move it "simultaneously" to both directions
 
Upvote 0

harinder

Active Member
Licensed User
Longtime User
Because I reread your post and misunderstood it and thought that the answer was wrong.
You could also use:
Scrollview2D.SmoothScrollTo(Scrollview2D.HorizontalScrollPosition, Scrollview2D.VerticalScrollPosition + 50dip)
Thanq Klaus..you are as helpful as ever
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
B4X:
But I am able to scroll only vertically despite sv2D as per my post #7
Why ?
If you set the Width of ScorllView2D.Width correctly you are able to scroll in both directions.
Then you can change the position with either
ScorllView2D.HorizontalScrollPosition
or
ScorllView2D.SmoothScrollTo(PosX, PosY)
 
Upvote 0
Top