Share Coding

Tutorials, Problems, Stuffs …

Programmatically disable Scroll function on Android WebView

WebView WebView1 = (WebView) findViewById(R.id.webView1);

//Only hide the scrollbar, not disables the scrolling:
WebView1.setVerticalScrollBarEnabled(false);
WebView1.setHorizontalScrollBarEnabled(false);

//Only disabled the horizontal scrolling:
WebView1.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

//To disabled the horizontal and vertical scrolling:
webview.setOnTouchListener(new View.OnTouchListener() {
	public boolean onTouch(View v, MotionEvent event) {
		return (event.getAction() == MotionEvent.ACTION_MOVE);
	}
});
Advertisements

One response to “Programmatically disable Scroll function on Android WebView

  1. Arush Ahuja 2014/01/12 at 2:09 am

    Thanks Alot….especially for: webview.setOnTouchListener

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: