更快的 UIWebView?
我用 HTML + CSS + jQuery 开发了一个游戏。这是一个简单的打地鼠游戏,在浏览器上运行得非常好,但在 iPad2 上运行的 UIWebView 上有点卡顿。
我正在通过我创建的一个简单的应用程序加载 UIWebView,该应用程序除了该 webview 之外没有其他任何东西。
我发现对触摸的响应很差,而且还有一点滞后。
大家知道有什么办法可以优化吗?
任何帮助将不胜感激。
干杯
I developed a game with HTML + CSS + jQuery. It's a simple Whac-a-mole game, which runs really well on the browser but is stuttering a bit on a UIWebView running on an iPad2.
I'm loading the UIWebView through a simple App I created, which has nothing else but that webview.
I find that the response to touches is quite poor and there's a bit of lag as well.
Do you guys know if there's a way to optimise it?
Any help will be much appreciated.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜测该应用程序在浏览器中运行得更好,因为浏览器具有 Nitro JavaScript 引擎。我不确定 UIWebView 是否可以访问它。
I'm guessing the app runs better in the browser because the browser has the Nitro JavaScript engine. I'm not sure the UIWebView has access to it.
图形加载和调整大小通常会对性能造成巨大影响。如果其中一个移动图形需要不断调整大小怎么办?正如尼克的评论所说 - 对其进行概要分析。分析 JavaScript。
Graphics loading and resizing are often huge performance hits. What if one of the moving graphics needs to be resized constantly? As the comment from Nick says - profile it. Profile the javascript.