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' 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."

    链接地址: http://www.djcxy.com/p/30552.html

    上一篇: 在listview中插入单个视图使listItem不可点击

    下一篇: ListView项目在触摸时不会显示焦点