Until now I have been an iPhone developer only and now I have decided to give Android a whirl. Something I haven’t been able to figure out on Android is how to programmatically prevent scrolling in a WebView?
Something similar to iPhones prevention of the onTouchMove event would be great!
Here is my code for disabling all scrolling in webview:
To only hide the scrollbars, but not disable scrolling:
or you can try using single column layout but this only works with simple pages and it disables horizontal scrolling:
You can also try to wrap your webview with vertically scrolling scrollview and disable all scrolling on the webview:
And set
Don’t forget to add the
webview.setOnTouchListener(...)code above to disable all scrolling in the webview. The vertical ScrollView will allow for scrolling of the WebView’s content.