【问题标题】:In Android Webview loaded URL in which EditText is not getting focus and keyboard is not launching在 Android Webview 加载的 URL 中,EditText 没有获得焦点并且键盘没有启动
【发布时间】:2017-09-13 07:57:41
【问题描述】:

以下 URL 已在 webview 中加载,并且 EditText 字段未获得焦点 结果键盘没有显示出来。

在 WebView 中加载的 URL: https://docs.google.com/forms/d/e/1FAIpQLSeICt0NT0xWZZV1iwLEaaZnnw5n5-8iRGt6HGQHQ9QFq1xpyA/viewform?c=0&w=1

尝试过的解决方案: Why is Android WebView refusing user input?

任何帮助都将不胜感激。

【问题讨论】:

  • 可以显示您拥有的代码吗?你是怎么加载的?
  • 感谢您的宝贵时间,我解决了这个问题 android:focusableInTouchMode="true"
  • 好吧,没问题,您只需回答自己的问题。
  • 是的,感谢您提供的信息。

标签: android android-webview


【解决方案1】:

发现问题:

<WebView
            android:id="@+id/common_webview_id"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:focusableInTouchMode="true"></WebView>

问题是“focusableInTouchMode”属性值设置为
"false" 即 android:focusableInTouchMode="false" 它应该是 "true" 编辑文本以获得焦点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-28
    相关资源
    最近更新 更多