Reputation: 35
I have one webview. I know how to programmatically scroll down it when page is loaded.
My problem is that I want to prevent the user from scrolling up at the place that I programmatically scrolled down.
Any ideas?
Upvotes: 3
Views: 165
Reputation: 635
Instead of programmatically scroll down do those changes in xml.
<WebView
android:layout_marginTop="-10dp"
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
This will crop the content that you want to hide from top
Upvotes: 3
Reputation: 2350
Use following:
WebView wv = new WebView(this);
wv.setFocusable(false);
and to make it clickable again:
wv.setFocusable(true);
Upvotes: 1