As of now the best way is to use android:fadeScrollbars="false"
in xml which is equivalent to ScrollView.setScrollbarFadingEnabled(false);
in java code.
or
Setting the android:scrollbarFadeDuration="0"
will do the trick.
Eg: in your onCreate() method : try this :
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.your_web_view_layout);
browser = (WebView)findViewById(R.id.your_webview);
WebSettings mWebSettings = browser.getSettings();
mWebSettings.setBuiltInZoomControls(true);
browser.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
browser.setScrollbarFadingEnabled(false);
browser.loadUrl("file:///android_asset/index.html");
}
OR
Try using WebView
inside a ScrollView
and use android:fadeScrollbars="false"
for the ScrollView
Eg:
<ScrollView android:layout_width="fill_parent"
android:layout_height="86px"
android:id="@+id/scrollTxtDescription"
android:fadeScrollbars="false"
android:layout_below="@id/txtLieuPromo1"
android:layout_alignLeft="@id/txtLieuPromo1">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/layoutTxtDescription"
>
<WebView android:id="@+id/txtDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</ScrollView>