Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webview prevent scroll up from specific height

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?

like image 596
Mehmet London Avatar asked Sep 02 '26 15:09

Mehmet London


1 Answers

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

like image 125
BooDoo Avatar answered Sep 04 '26 05:09

BooDoo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!