ListView items focus behaviour

后端 未结 2 570
忘掉有多难
忘掉有多难 2021-01-03 15:38

I\'m trying to create a ListView (with custom CursorAdapter) of EditText items such that EditTexts appear uneditable at f

2条回答
  •  渐次进展
    2021-01-03 16:10

    I was able to make some progress by using two views on top of each other. I'm using a TextView for unfocused display, and I hide it and show an EditText instead on long clicked. But that didn't really help at first with ListView's really weird focus handling until I've experimented with android:descendantFocusability setting defined for ViewGroups. After I've set it to ViewGroup.FOCUS_AFTER_DESCENDANTS it's behaviour became much more predictable, at least for me.

提交回复
热议问题