i have a webview with the below code:
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);
If i comment webView.setOnTouchListener(onTouchListener);
this then webview will scroll but if i add it then the webview will not scroll any reason why so?
EDIT
My Listener
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;
}
};
Your onTouchListener
variable is referencing an implementation that always returns true
?
From the documentation at
http://developer.android.com/reference/android/view/View.OnTouchListener.html
Returns
True if the listener has consumed the event, false otherwise.
Make sure to return false
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With