【发布时间】:2021-11-10 20:40:24
【问题描述】:
我正在尝试使用 android webView 创建一个混合应用程序。
这是我的问题:
我在 webView 上有一个 webView 和一个 touchListener。我希望点击事件下降到 html 但阻止 doubleTap 从到达 webview 内部的 html。
这是我的代码:
webView.setOnTouchListener { v, event ->
//returning true here prevents all kind of touches from reaching html
true
}
上面的代码阻止了所有的触摸到达 html。 我想要这样的东西:
webView.setOnTouchListener { v, event ->
if (doubleTap) {
//return true and prevent doubleTap from reaching html
true
} else (!doubleTap) {
//return false and let html recieve tap or any other gesture!
false
}
}
顺便说一句,我不想用 JavaScript 或我的 html 页面中的任何东西来处理这个问题! (告诉我代码是否很短,您需要更多信息) 谢谢大家!
【问题讨论】:
标签: android kotlin touch-event