How to improve the scroll performance of webapp in webview of retina device

我的未来我决定 提交于 2019-12-11 23:03:40

问题


I have a iPad3(ios5):
I load my webapp html locally,I disable all the css3 effect like box-shadowand everything I can optimize like what I used to optimized a website, etc.
And All my effort focus on css/html(I don't even execute any javascript),yet I still couldn't get to a tolerable fps

did I miss something?Is it just a performance issue like a bug or something else in ios5?
What's the best practice to improve the scroll performance in webapp?


回答1:


I have been struggling with most likely the same problem (see my SO question here)

I do use iScroll and recently I had another performance issue in iOS6.1.3 but with the iScroll itself. I was able to solve it by explicitly add css to get hardware acceleration on the iScroll.

I used a specific page id to assign the css but you can decide yourself where you need to add it if it would help for your case as well.

CSS:

#myid * {
    -webkit-transform: translate3d(0, 0, 0);
}

my iscroll uses the classes s-scrollwrapper and s-scrollpane which might be better choices to add the css to enforce hardware acceleration. Then the css would be

.s-scrollwrapper * {
    -webkit-transform: translate3d(0, 0, 0);
}

or

.s-scrollpane * {
    -webkit-transform: translate3d(0, 0, 0);
}

Hope this helps you improving the speed on iOS5 as well.

Webapp on iPad 3 retina display slow screen painting



来源:https://stackoverflow.com/questions/18306822/how-to-improve-the-scroll-performance-of-webapp-in-webview-of-retina-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!