I saw this issue with one webview on HTC phones. One of the comments in this error stream provides some recommendations for optimizing WebView performance. The error is related to 3D transforms, but I found comment methods useful for WebView in general.
This presentation on Google I / O 2012 also contains some useful information on the topic of WebViews in general.
Both suggest that dynamic content is placed on a “layer”. This means that this CSS rule is assigned to the element:
-webkit-transform: translate3d(0, 0, 0);
By applying this rule, Android "tells the browser to pre-compose the layer on its own texture so that it can be animated later (almost) for free." This behavior is not free - it can consume more memory, so I would use it wisely. The above presentation explains well why.
In my case, I was able to avoid the “white screen” by applying this rule to the DIV that wraps the entire page. The page will sometimes appear white for a second, and then display the content. I did not see the “white” page remain forever, as I did before applying this technique. I did not see memory consumption out of control. YMMV.
I also suggest you do your best to simplify the layout. Easier said than done, but some good suggestions can be found in the docs .
Thomas brice
source share