触摸时的ListView项目将不会显示焦点 [英] ListView items won't show focus when touched

查看:97
本文介绍了触摸时的ListView项目将不会显示焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到了工作好了,除了这个小麻烦一个ListView。我可以使用轨迹球/ DPAD来上下移动我的名单,并根据该行已关注背景变化。但是,当我触摸行(点击或长按),没有背景的变化让我知道什么是一直专注。我试过设置为true行聚焦的'和'联系方式可聚焦,但它仍然无法正常工作。

以防万一它在某种程度上事项:


  • 我设置onClickListeners
    每一行。

  • 行是由
    LinearLayouts,TextViews,和一个
    单ImageView的。

  • 可调焦/点击为每个行真。有没有关于在ListView指定值这些。

  • 可跟踪并采取行动滑稽。我可以行之间的ListView控件内触及后才移动。如果我滚动轨迹球的第一项以上,这是不可能的,我回滚动列表。

有什么想法?


解决方案

  

我可以使用轨迹球/ DPAD移动
  上下我的名单,以及
  根据背景的变化到
  行有焦点。


没有,没有。根据该行的背景变化被选中。选择和重点是不太一样的东西。


  

但是,当我接触到的行(或点击
  长按),没有背景
  改变让我知道什么是被
  重点突出。


以触摸模式中,不存在焦点和无选择。

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

这篇关于触摸时的ListView项目将不会显示焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆