I'm making a browser based on android WebView class. I want to enable both horizontal and vertical scrolls on the webview and want it to behave exactly like the android browser? Is there any setting for that in the manifest file or shall i override the default webviewclient class.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With