突出显示的ListView选择行 [英] Highlight ListView selected row

查看:143
本文介绍了突出显示的ListView选择行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的专辑(几百个)的列表。 当我触摸选择的专辑我想为用户提供播放整张专辑,或者移动到它的轨迹ListView的选择。没问题。 然而,在接触的albumListView后ablum我想该行保持突出显示,以便用户知道他们已经单击的项目上,然后可以移动到确定或播放。我如何突出Lis​​tView中的行?

I have a list of albums (several hundred). When I touch the selected album I want to offer the user a choice of playing the whole album, or moving to its track ListView. No problem. However, after touching the ablum in albumListView I want the row to remain highlighted so the user knows which item they have clicked on, and can then move to OK or PLAY. How do I highlight a row in ListView?

推荐答案

从<一个报价href="http://android-developers.blogspot.de/2008/12/touch-mode.html">http://android-developers.blogspot.de/2008/12/touch-mode.html

想象一下,一个简单的应用程序,ApiDemos例如,显示文本项的列表。通过列表中使用轨迹球,用户可以自由浏览而且,可选地,滚动和使用触摸屏甩列表。在这种情况下的问题是如何处理的选择正确,当用户操作通过触摸屏的列表中。

Imagine a simple application, ApiDemos for example, that shows a list of text items. The user can freely navigate through the list using the trackball but also, alternatively, scroll and fling the list using the touch screen. The issue in this scenario is how to handle the selection properly when the user manipulates the list through the touch screen.

在这种情况下,如果用户在列表的顶部选择一个项目,然后甩向底部的列表中,会发生什么给选择?是否应该继续留在项目和滚动关闭屏幕?会发生什么情况,如果用户随后决定将轨迹球选择?更糟的是,又该如果用户presses轨迹球在当前选择的项目,这是不显示在屏幕上了行动发生的呢?

In this case, if the user selects an item at the top of the list and then flings the list towards the bottom, what should happen to the selection? Should it remain on the item and scroll off the screen? What should happen if the user then decided to move the selection with the trackball? Or worse, what should happen if the user presses the trackball to act upon the currently selected item, which is not shown on screen anymore?

经过慎重考虑,我们决定完全消除选择,当用户操作通过触摸屏用户界面。

After careful consideration, we decided to remove the selection altogether, when the user manipulates the UI through the touch screen.

<强>在触摸模式中,不存在焦点和无选择。中的在网格成为未选只要用户进入触摸模式的列表的任何选择的项目。同样,任何聚焦的窗口小部件成为非聚焦当用户进入触摸模式。下面的图像示出当用户触摸选择与所述轨迹球的项后的列表会发生什么。

In touch mode, there is no focus and no selection. Any selected item in a list of in a grid becomes unselected as soon as the user enters touch mode. Similarly, any focused widgets become unfocused when the user enters touch mode. The image below illustrates what happens when the user touches a list after selecting an item with the trackball.

这篇关于突出显示的ListView选择行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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