我正在使用GWT 2.4。在 ipad(ios 7( 中查看 Web 应用程序时,滚动有延迟。滚动事件仅在触摸结束事件完成后触发,因此有时看起来无响应。当我尝试滚动时,滚动也会冻结,而滚动已经发生。有人有同样的问题吗?请帮助我。
protected void addContentPane()
{
ScrollPanel touchScroller = new ScrollPanel();
touchScroller.setStyleName("touchScrollContainer");
touchScroller.setSize((width - 2) + "px", contentPaneHeight + "px");
touchScroller.getElement().setId(tabID);
touchScrollPane = new HTML("", true);
touchScrollPane.setHTML("A big boring String....");
touchScroller.setWidget(touchScrollPane);
contentPane.add(touchScroller);
}
}
这是我
的代码,它直接来自展示。正如我所说,我测试了GWT 2.5.1,mgwt 1.1.2,iOS7
public ScreenViewA(String id, boolean isOptions) {
main = new LayoutPanel();
scrollPanel = new ScrollPanel();
scrollPanel.setScrollingEnabledX(false);
headerPanel = new HeaderPanel();
title = new HTML();
headerPanel.setCenterWidget(title);
headerBackButton = new HeaderButton();
headerBackButton.setBackButton(true);
headerBackButton.setVisible(!MGWT.getOsDetection().isAndroid());
headerMainButton = new HeaderButton();
headerMainButton.setRoundButton(true);
headerPanel.setLeftWidget(headerBackButton);
main.add(headerPanel);
scrollPanel.setUsePos(MGWT.getOsDetection().isAndroid());
}
在稍微调试了一下javascript之后,我发现我包含在项目中的某些jar导致了延迟。罐子是大气-gwt-client-1.0.18.jar。
还发现我在 CSS 中使用带有输入类型文本框的 ACTIVE 导致了问题。我用它来删除文本框处于活动状态时在 webkit 浏览器中显示的轮廓。