Android禁用Webview输入 [英] Android disable webview input
问题描述
我有一个布局,其中包含一个Web视图以及该Web视图顶部的各种UI元素.这是一个相对布局.
I have a layout that features a webview and various UI elements on top of the webview. This is a relativelayout.
当前,无论在Web视图顶部可见多少元素,所有滚动都将滚动Web视图,它仍然可以接受点击等操作.我想有条件地禁用webview的这些功能
Currently, no matter how many elements are visible on top of the webview, all scrolling will scroll the webview, it can still accept clicks and more. I want to conditionally disable these features of the webview
我正在使用myWebview.setClickable(false)
,但这似乎没有效果
I am using myWebview.setClickable(false)
but this seems to have no effect
有见识
推荐答案
对此我没有信心,但是也许强迫WebView放弃关注的重点.尝试myWebview.clearFocus()
.让我知道这是否有效.我现在不在电脑旁,否则我会知道的. :)
I'm not confident about this, but perhaps forcing the WebView to drop its focus will do. Try myWebview.clearFocus()
. Let me know if that worked or not. I'm not at my computer right now, otherwise I would know. :)
这篇关于Android禁用Webview输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!