Android WebView Scrollable

The WebView documentation says:

By default, a WebView provides no browser-like widgets

It also says:

A WebView has several customization points where you can add your own behavior. These are:

Creating and setting a WebViewClient subclass. It will be called when things happen that impact the rendering of the content, eg, errors or form submissions. You can also intercept URL loading here.

Which suggests WebViewClient has nothing to do with the scroll bars, since they’re not content.

I was going to suggest putting a WebView inside of a ScrollView, but looking at this link it seems WebView’s default behaviour is to include scroll bars, which makes sense since a lot of scrollbar functionality is defined in the high level View class. Have you tried just making a regular WebView? If so, have you tried adding the following in your java code?

WebView v = (WebView) findViewById(R.id.webview); 
v.setVerticalScrollBarEnabled(true);
v.setHorizontalScrollBarEnabled(true);

Leave a Comment