EditText in Listview loses focus when pressed on Android 4.x

后端 未结 9 1174
孤城傲影
孤城傲影 2020-11-29 03:13

I know there are a lot of similar questions out here but I couldn\'t get any of the provided solutions working in a simple sample app.

The problem occurs when the

相关标签:
9条回答
  • 2020-11-29 04:00

    When the list is long enough to cover the soft keyboard, the EditText in Listview loses focus when pressed on Android 4.x.

    One solution is to wrap the Listview in a linear layout with a height of half the screen.

    Whenever the Listview doesn't cover the softkeyboard, everything is fine.

    0 讨论(0)
  • 2020-11-29 04:01

    was having the same issue. Searched for all such solutions with inputMode, focusability et al. Best solution, migrate to recycler view.

    0 讨论(0)
  • 2020-11-29 04:04

    I was having the same problem with recyclerView and trying all suggested solutions.

    Finally, the problem on my case was that the recyclerView had wrap_content as value for the height on my XML by accident; changed it to match_parent and started working as expected, no focusable value set and using android:windowSoftInputMode="adjustResize"

    0 讨论(0)
提交回复
热议问题