Android WebView Advanced User Interface

I am creating a browser based on the Android WebView class. I want to include both horizontal and vertical scrolls in a webview and want it to behave exactly the same as the Android browser? Are there any settings for this in the manifest file or should I override the default webviewclient class.

+6
android android-layout android-manifest android-widget android-webview
Jun 06 2018-11-06T00:
source share
1 answer

WebView documentation says:

By default, WebView does not provide widgets like browsers

It also says:

There are several customization points in WebView where you can add your own behavior. It:

...

Create and configure a subclass of WebViewClient. It will be called when events occur that affect the rendering of content, such as errors or form submissions. You can also intercept the download URL here.

What WebViewClient offers has nothing to do with scrollbars since they are not happy.

I was going to suggest placing the WebView inside the ScrollView , but looking at this link , it seems that the default behavior of the WebView is to enable scrollbars, which makes sense since there are many scroll functions defined in the high-level View class. Have you tried just making a normal WebView? If so, have you tried adding the following to your Java code:

 WebView v = (WebView) findViewById(R.id.webview); v.setVerticalScrollBarEnabled(true); v.setHorizontalScrollBarEnabled(true); 
+8
Jun 06 '11 at 16:51
source share



All Articles