转载自mjjmjc
实现WebView只能上下滚动不能对内容进行点击(enable scroll and disable click),主要有两个步骤:
1、添加ScrollView
2、禁止WebView的点击事件传递
一、主要布局编写
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<WebView
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</ScrollView>
二、禁止WebView点击
webView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});