Manish Lomte
Manish Lomte

Reputation: 329

Web view flicker/blinks while scrolling

I am working on hybrid application, there are HTML5 files which i bundled within application. I need to play video on some HTML pages for that i used android:hardwareAccelerated="true" permission in manifest file.

But when i scroll webview it flicker/blinks the view.

Please let me know how to resolve this issue.

Thanks in advance.

Upvotes: 8

Views: 7321

Answers (3)

Alécio Carvalho
Alécio Carvalho

Reputation: 13657

It seems that the android:hardwareAccelerated="true" is the root of the problem. If you really need it, you can solve this issue by calling:

webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

It requires API level 11, so you can wrap it in a method like this:

@TargetApi(11)
protected void configureLayerType(WebView webView) {
    webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);
}

Upvotes: 3

Dimmy3
Dimmy3

Reputation: 1116

I've added:

android:layerType="software"

to WebView, and it magically solved the problem.

Of course, left out hardware acceleration.

Upvotes: 14

Akilan
Akilan

Reputation: 1717

Android web view Rendering Engine makes flickering usually. U can use some javascript mobile frameworks like JQMobi, Enyo js, JQuery Easing JS to solve this issue.

But what basically i experimented is html browser rendering always flickering in my case.

Upvotes: 0

Related Questions