scroller.scrollTo in Sencha Touch don't work i

2019-04-13 07:44发布

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条回答
地球回转人心会变
2楼-- · 2019-04-13 08:10

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

Solution:

 if (myPanel.scroller.offsetBoundary.top == 0) {
        myPanel.scroller.updateBoundary();
    }
查看更多
登录 后发表回答