【问题标题】:Edittext in listview not showing soft keyboard列表视图中的Edittext不显示软键盘
【发布时间】:2013-11-24 16:19:28
【问题描述】:

我在列表视图项中使用了edittext。但即使设置活动android:windowSoftInputMode =“adjustPan”,它也无法正常工作。有没有办法解决这个问题。 提前谢谢你。

【问题讨论】:

  • 您在持有列表视图的活动上添加 android:windowSoftInputMode="adjustPan"?
  • 是的,我试过了,但还是不行。

标签: android-layout


【解决方案1】:

如果布局显示时没有 EditText,它不会加载键盘,请将其粘贴到布局的开头。

    <EditText
        android:visibility="gone"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    ... 
    <ListView ...

【讨论】:

    【解决方案2】:

    将此添加到您的视图中。 android:descendantFocusability="beforeDescendants"

    【讨论】:

    • 我知道这是一个旧答案,但您能否指定我应该将此属性添加到哪个视图?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-08
    • 2023-03-08
    • 1970-01-01
    • 2019-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多