scroller.scrollTo in Sencha Touch don't work if not launched manually just before

我是研究僧i 提交于 2019-12-06 10:54:55

问题


I encounter a problem when i want to use the scrollTo function of the scroller component.

When i execute this command (by a button located on an another panel) :

myPanel.scroller.scrollTo({x: 0, y: 200}, true);

My panel is scrolling only if just before, i have scroll it manually by touching the screen. It's like i have lost focus on the scroller.

Someone have an idea of where is the problem ?

Thank you.


回答1:


That's because the scoller doesn't know the boundaries of its wrapped widget.

Solution:

 if (myPanel.scroller.offsetBoundary.top == 0) {
        myPanel.scroller.updateBoundary();
    }


来源:https://stackoverflow.com/questions/6455413/scroller-scrollto-in-sencha-touch-dont-work-if-not-launched-manually-just-befor

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