The problem is that I'm using the fullScroll()
and scrollTo()
functions to scroll but it is animated and I need it happen without user observation.
Is there a way to solve this problem?
hScrollView.post(new Runnable() {
@Override
public void run() {
hScrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
}
});
In Android, a ScrollView is a view group that is used to make vertically scrollable views. A scroll view contains a single direct child only. In order to place multiple views in the scroll view, one needs to make a view group(like LinearLayout) as a direct child and then we can define many views inside it.
Use this
// Disable the animation First
hScrollView.setSmoothScrollingEnabled(false);
// Now scroll the view
hScrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
// Now enable the animation again if needed
hScrollView.setSmoothScrollingEnabled(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With