Sandip Fichadiya
Sandip Fichadiya

Reputation: 3480

How to scroll with animation

I am trying to create an app for which i need to scroll down programmatically upon receiving some message..

I have tried using ScrollView using following code

ScrollView mScrollView;
mScrollView = (ScrollView)findViewById(R.id.abc);

mScrollView.post(new Runnable() { 
                public void run() { 
                     mScrollView.scrollTo(0, mScrollView.getBottom());

                } 
        });

It works and it takes me to bottom , but there's no animation like actual scrolling. How can i get "scrolling animation" along with that?

is there any other way to scroll programmatically with animation? please help me out.

Upvotes: 2

Views: 401

Answers (1)

pskink
pskink

Reputation: 24740

try using ScrollView.smoothScrollTo method

Upvotes: 3

Related Questions