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

后端 未结 9 1234
孤城傲影
孤城傲影 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.

提交回复
热议问题