如果之前没有手动启动,则Sencha Touch中的scroller.scrollTo不起作用 [英] scroller.scrollTo in Sencha Touch don't work if not launched manually just before
本文介绍了如果之前没有手动启动,则Sencha Touch中的scroller.scrollTo不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我想使用滚动条组件的scrollTo函数时遇到问题。
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 ?
谢谢。
推荐答案
这是因为scoller不知道其包装小部件的边界。
That's because the scoller doesn't know the boundaries of its wrapped widget.
解决方案:
if (myPanel.scroller.offsetBoundary.top == 0) {
myPanel.scroller.updateBoundary();
}
这篇关于如果之前没有手动启动,则Sencha Touch中的scroller.scrollTo不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文