开发者

android scrollView max scroll

Is there a way to add a range of scrolling to a scrollView? I've done a screen where user can drag views and I want to limit the possibility of 开发者_开发知识库dragging them down to some coordinates and modify those coordinates at runtime according to the number of object from view.


You can use some code like this:

if(scrollView.scrollY() >= limit)
scrollView.setOnTouchListener(null);

To disable scrolling if user tries to scroll further than limit that you decided.

Edit: here, limit is coordinates typed int

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜