PhoneGap的 - 科尔多瓦功能延迟非常明显慢于Android和iOS设备科尔、明显、多瓦、功能

2023-09-05 06:40:35 作者:伤若堆成海

我刚刚开始使用Zend Studio的我第一次的PhoneGap项目。但是,在我构建和部署,应用程序相当缓慢。双方在Android和iOS。滚动落后,如果我preSS一个按钮,它的下一个页面慢跳转。请问有什么办法可以提高它的性能呢?在此先感谢

I just now started with my first PhoneGap project using zend studio. But, after i build and deploy it, the application is quite slow. Both on android and iOS. The scrolling is lagging, and if i press a button, it's slow to goto the next page. Is there any way to improve it's performance ? Thanks in advance

推荐答案

自4.0.4版本中,有一种被称为错误的地方,如果硬件加速时,它实际上会减慢屏幕重绘事件。这就是为什么滚动速度很慢。

Since version 4.0.4, there is a known "bug" where if hardware acceleration is on, it will actually slow down screen redraw events. This is why scrolling is slow.

在三星Galaxy III和IV,帆布不会使任何东西,直到我们关闭硬件加速。一旦我们做的帆布绘画表现良好。

On the Samsung Galaxy III and IV, canvas would not render anything at all until we turned off hardware acceleration. Once we did canvas drawing performed well.

您可以关闭硬件加速您的WebView这一行的code。在你的应用程序的Java文件:

You can turn off hardware acceleration for your webview with this line of code in your app java file:

super.appView.setLayerType(WebView.LAYER_TYPE_SOFTWARE,NULL);

super.appView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

这可以被固定为4.4(奇巧使用Chromeview而不是web视图)。

This may be fixed as of 4.4 (KitKat uses Chromeview rather than webview).