Android禁用WebView touch,但保持缩放/滚动 [英] Android disable WebView touch but keep zooming/scrolling

查看:86
本文介绍了Android禁用WebView touch,但保持缩放/滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种禁用WebView触摸的方法,以使用户无法单击html链接,但保留WebView的缩放和滚动功能.

I am looking for a method to disable touch on a WebView so user's are not able to click on html links but keep the zooming and scrolling functions of the WebView.

推荐答案

下面的代码允许您滚动,但是单击链接时将不会转到下一页.

the code below allow you scroll but when click at the link it won't go to next page.

webView.setLongClickable(false);

webView.setOnTouchListener(new View.OnTouchListener()
{

  @Override

  public boolean onTouch(View arg0, MotionEvent arg1)
  {

       return arg1.getAction() == MotionEvent.ACTION_UP;

  }
}

);

这篇关于Android禁用WebView touch,但保持缩放/滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆