auto scroll to the bottom of container in sencha touch 2

一世执手 提交于 2019-12-25 14:00:15

问题


I have a view that contains 2 parts: + Part 1: an ADD button + Part 2: a container LIST that has scroll attribute is auto.

When user clicks on button ADD, the system will add a container to container LIST. User can add as much as they want.

But my container LIST has limit height so I want to scroll to new container that added to container LIST when user clicks ADD button. Anyone help me. Thanks


回答1:


I tried to use:

var scroller = pan.getScrollable().getScroller();
scroller.scrollToEnd(true);

But it's not working. Then I tried another way:

var scroller = pan.getScrollable().getScroller();
scroller.scrollTo(x,y,true);// y = 100000000000

It's work :)




回答2:


var scroller = myListObject.getScrollable().getScroller();
scroller.scrollToEnd();


来源:https://stackoverflow.com/questions/17714149/auto-scroll-to-the-bottom-of-container-in-sencha-touch-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!