ICS中的WebView触摸事件未正确触发 [英] WebView in ICS touch events not being fired properly

查看:130
本文介绍了ICS中的WebView触摸事件未正确触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ICS webview(与2.3.3的较早版本兼容)中,我正在加载html文件并编写了一些与javascript中的touchmove和touchend之类的触摸事件链接的函数.但是ICS中的问题是有时无法识别设备上的点击,甚至logcat中也没有错误,有人可以解决此问题吗?预先感谢.

In ICS webview (which is compatible with older versions like 2.3.3) I am loading html file and wrote some functions which are linked with touch events like touchmove and touchend in javascript. But the problem in ICS is clicks on device is not recognized some times and no error in logcat even, can someone has work around for this problem? Thanks in advance.

推荐答案

可能是您的设备将它们视为mouseevent. (吸...)

It could be your device treat them as mouseevents. (sucks...)

我正面临类似的问题.我不确定这是我的平板电脑问题还是ICS默认浏览器/网络视图的普遍问题.

I am facing a similar problem. I am not sure if it's the problem of my tablet or it's a general problem for ICS default browser/webview.

测试以下内容.

  1. 写没有jQuery/plugin的html/js:
    • 将某些功能绑定到鼠标事件(mousedown/mousemove/mouseup)和触摸事件(touchstart/touchmove/touchend/touchcancel)以进行跟踪
    • 因此,您可以跟踪鼠标是否按下/鼠标移动/鼠标移动/触摸开始/触摸移动/触摸网页
    • 将网页上传到网络上
  1. Write the html/js without jquery/plugin:
    • bind some functions to mouseevents (mousedown/mousemove/mouseup) and touchevents (touchstart/touchmove/touchend/touchcancel) to trace them
    • So, you can trace if you mousedown/mousemove/mouseup/touchstart/touchmove/touchend the webpage
    • upload the webpage to the web
  • 使用PC(任何浏览器),都应将其作为鼠标事件进行跟踪
  • 使用智能设备,应将其作为触摸事件进行跟踪
  • 使用Android 2.3.X(任何浏览器),都应将其作为触摸事件进行跟踪
  • 使用Android ICS的Chrome浏览器,将其作为触摸事件进行跟踪. (好)
  • 使用Android ICS的默认浏览器,将其跟踪为mouseevents. (什么!!)

更糟糕的是,在我的ICS设备(默认浏览器)中:

Even worse, in my ICS device (default browser):

  • 从不在我的ICS的默认浏览器中触发touchevent.如果我触摸该网页,它将显示mousedown/mousemove.
  • 设备确实支持创建触摸事件(document.createEvent),这是一个谎言.
  • mouseevents序列未完成.因此,即使我的代码同时支持mouseevents和touchevents,mouseevent函数仍然不能支持此ICS设备.

这篇关于ICS中的WebView触摸事件未正确触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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