Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to animate scroll position? How to scroll smoothly?

I wish to move smoothly to next scroll position in my custom view (on button press or event). How to implement this? First of all I can't see scroll animation class (only alpha, rotate, scale and translate). Secondly, having animation class, I can't see iterative one (say to scroll 100 pixels rights whatever position we have) only absolute ones (i.e. to animate from one constant value to another).

like image 975
Suzan Cioc Avatar asked May 16 '12 15:05

Suzan Cioc


People also ask

How do I make my scroll to view smooth?

Native method: scrollIntoView scrollIntoView is JavaScript method that supported by modern browsers, like Chrome, Firefox and Edge. The usage is simple, just like this: function scroll(e) {e. scrollIntoView({behavior: "smooth", block: "start"});}scroll(document.

How does smooth scrolling work?

Smooth scrolling is also useful with keyboard shortcuts. When this feature is enabled, pressing the Page Down button won't just jump directly down one page. With smooth scrolling, it slides down smoothly, so you can see how much it scrolls.

What is smooth scrollbar?

Smooth Scrollbar is a JavaScript Plugin that allows you customizing high perfermance scrollbars cross browsers. It is using translate3d to perform a momentum based scrolling (aka inertial scrolling) on modern browsers. With the flexible plugin system, we can easily redesign the scrollbar as we want.


1 Answers

Assuming you are using a ScrollView, does smoothScrollTo(...) work for you?

http://developer.android.com/reference/android/widget/ScrollView.html#smoothScrollTo%28int,%20int%29

like image 79
Ian Warwick Avatar answered Sep 20 '22 22:09

Ian Warwick