Any way to stop WebView built in scrolling

android, scroll, webview

Solution

Finally I've found the answer myself..:P

we can stop or start scrolling and scaling of the page by doing some javascript stuff in the page. Here is the javascript code:

function stopScroll()
{
    document.ontouchmove = function(e){ e.preventDefault(); }
}

function startScroll()
{
    document.ontouchmove = function(e){ return true; }
}

Now you can call these functions using your android webview using following:

myWebView.loadUrl("javascript:stopScroll()");

By calling above function stopScroll from the HTML page will be called. Cheers!!!

Problem

I am developing an application in which I've to use a webview. My question is CAN WE STOP WEBVIEW's BUILT IN SCROLLING FUNCTIONALITY? I have tried this so for: in onScrollChanged super.scroll(0,0); But this wont help me. I'm looking for something like we can stop zooming using the webview settings... Anyone having better Idea other then this would be great.

Original source

Related problems