I want to hide a vertical scroll bar in my WebView when I do not scroll the page. As for now, it is displayed always. I create a WebView programmatically, so my question is
No need to change your Java code.
It will work if you put android:scrollbars="none"
in your XML.
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none" />
Try this -
For vertical scrollbar -
webView.setVerticalScrollBarEnabled(false)
For Horizontal scrollbar -
webView.setHorizontalScrollBarEnabled(false);
setScrollbarFadingEnabled() method does exactly what you want. It hides scrollbar when the view isn't scrolling.
webView.setScrollbarFadingEnabled(true);
try this code,
webView.setVerticalScrollBarEnabled(false);
Set scrollbars
to none
in the XML for WebView. For reference try this code.
<WebView android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none"/>
This finally worked for me:
mWebView.setVerticalScrollBarEnabled(false);