有效代码:
// disable scroll on touch
webview.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return (event.getAction() == MotionEvent.ACTION_MOVE);
}
});
————————————————————————————
以下是其它webView设置效果:
1.仅仅是隐藏滚动条ScrollBar,但滚动效果依然保留:
only hide the scrollbars, but not disable scrolling:
WebView.setVerticalScrollBarEnabled(false);
WebView.setHorizontalScrollBarEnabled(false);
2.在xml中设置滚动
scrollbars = none
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical" >
<WebView
android:id="@+id/mywebview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none" />
</ScrollView>
然后
webview.setScrollContainer(false);
have fun
转载署源-By-KyleCe:http://blog.csdn.net/kyleceshen/article/details/50381320