开发者

Android ScrollView isFinished?

开发者 https://www.devze.com 2023-01-22 10:34 出处:网络
Just looking 开发者_开发知识库for an easy answer that I can\'t find on Google. Simply put. Is there a way to tell when ScrollView has stopped scrolling after a fling?Yes, after fling it comes in ideal

Just looking 开发者_开发知识库for an easy answer that I can't find on Google. Simply put. Is there a way to tell when ScrollView has stopped scrolling after a fling?


Yes, after fling it comes in ideal state which means that your fling is over. For this you have to put listener on your list view Like list.setOnScrollListener(this). Then you have to check in the listener that if it's in ideal state or not. like this

public void onScrollStateChanged(AbsListView view, int scrollState) 
{          
     if(OnScrollListener.SCROLL_STATE_IDLE)
    {
        your code;
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号