nios
nios

Reputation: 1173

Android webview display gets messy on Galaxy S4

When loading certain webviews on Galaxy S 4 (v 4.2.2), display gets messy when user interacts with HTML inputs.

After looking through SO and other sources, it seems that the problem is due to the device incorrectly or partially drawing the webview as it changes.

I tried to set the following, without success :

In manifest :

<application
    ...
    android:hardwareAccelerated="true">

or

<application
    ...
    android:hardwareAccelerated="false">

In activity :

mWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);

mWebView.getSettings().setPluginState(android.webkit.WebSettings.PluginState.ON_DEMAND);

mWebView.setScaleType(XXX); (I tried everything)

I also found out that logcat prints something like : "onSizeChanged x:XXX y:YYY" when bug happens.

This issue seems to only happen on this specific device (tried on Galaxy S2, Galaxy Note 2 and Nexus 4).

Any thoughts ?

Upvotes: 3

Views: 1471

Answers (1)

nios
nios

Reputation: 1173

After a lot of struggling to find a decent solution, the final fix was to REMOVE the following from css:

-webkit-transform: translate3d(0,0,0) 

The weird thing is that in this SO topic, it was advised to ADD this attribute to fix a similar problem... I don't exactly know what this line does, but if you meet a similar issue, I strongly advise you to look your CSS for this attribute.

Hope this helps somebody !

Cheers.

Upvotes: 1

Related Questions