解决方案:
webView?.requestFocus(View.FOCUS_DOWN)
webView?.setOnTouchListener { v, event ->
when (event.action) {
MotionEvent.ACTION_DOWN, MotionEvent.ACTION_UP -> if (!v.hasFocus()) {
v.requestFocus()
}
}
false
}
网友评论