ListView items won't show focus when touched
I've got a ListView that works just great, except for this minor annoyance. I can use the trackball/dpad to move up and down my list, and the background changes according to which row has focus. But when I touch the row (click or long click), there's no background change letting me know what's been focused. I've tried setting 'focusable' and 'focusable in touch mode' to true on the rows, but it still doesn't work.
Just in case it matters somehow:
- I am setting onClickListeners for each row.
- The row is comprised of LinearLayouts, TextViews, and a single ImageView.
- Focusable/clickable is 'true'开发者_StackOverflow中文版 for each row. Have not specified values for these on the ListView.
- Trackable does act funny. I can only move between rows after touching inside the ListView. If I scroll trackball above the first item, it's impossible for me to scroll back into the list.
Any thoughts?
I can use the trackball/dpad to move up and down my list, and the background changes according to which row has focus.
No, it doesn't. The background changes according to which row is selected. Selection and focus are not quite the same thing.
But when I touch the row (click or long click), there's no background change letting me know what's been focused.
"In touch mode, there is no focus and no selection."
精彩评论