触摸时的ListView项目将不会显示焦点焦点、项目、ListView

2023-09-06 23:30:02 作者:活得潇洒一点

我已经得到了工作好了,除了这个小麻烦一个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."