Scrolling Performance in WebView for Android – Jelly Bean 4.1.x

Issue

I’m working on a PhoneGap project and I’ve noticed that in Jelly Bean (4.1.x), scrolling is laggy and slow. I’ve tried to add transform3d to the scrollable elements but that didn’t help. I can’t add hardwareAccerlerated to the manifest because we need to support 2.3.x.

Any suggestions on how to make the WebView scroll better on Android? I’ve stripped out all the CSS to make it basic.

This occurs on 2.0.0 of PhoneGap.

You can see a video of this here: https://www.dropbox.com/s/j17do2gry8vxhzo/scrollvdeo.mov

Solution

I figured you the issue. You need to set the target for your application to 3.0, and then set the minSDK attribute in our manifest file to be your lowest support OS. Then add android:hardwareAcceleratedtrue to the manifest. Worked like a charm!

Answered By – gregavola

Leave a Comment