我有一个带有以下代码的网络视图:
WebSettings webSettings = webView.getSettings();
webSettings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setSupportZoom(false);
webView.setBackgroundColor(0);
webView.loadDataWithBaseURL(null, text, "text/html", "UTF-8", null);
webView.setOnTouchListener(onTouchListener);
webView.setVerticalScrollBarEnabled(true);
如果我对此发表评论webView.setOnTouchListener(onTouchListener);
,那么 webview 将滚动,但如果我添加它,那么 webview 将不会滚动,为什么会这样?
编辑
我的听众
OnTouchListener onTouchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
if (action == MotionEvent.ACTION_UP) {
//do something
}
return false;
}
};