Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is my code for <strong>disabling all scrolling</strong> in webview:</p> <pre><code> // disable scroll on touch webview.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return (event.getAction() == MotionEvent.ACTION_MOVE); } }); </code></pre> <hr> <p>To only hide the scrollbars, but not disable scrolling:</p> <pre><code>WebView.setVerticalScrollBarEnabled(false); WebView.setHorizontalScrollBarEnabled(false); </code></pre> <hr> <p>or you can try using <strong>single column layout</strong> but this only works with simple pages and it disables horizontal scrolling:</p> <pre><code> //Only disabled the horizontal scrolling: webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); </code></pre> <hr> <p>You can also try to <strong>wrap your webview</strong> with vertically scrolling scrollview and disable all scrolling on the webview:</p> <pre><code>&lt;ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical" &gt; &lt;WebView android:id="@+id/mywebview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="none" /&gt; &lt;/ScrollView&gt; </code></pre> <p>And set</p> <pre><code>webview.setScrollContainer(false); </code></pre> <p>Don't forget to add the <code>webview.setOnTouchListener(...)</code> code above to disable all scrolling in the webview. The vertical ScrollView will allow for scrolling of the WebView's content.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload