ListView 的 state_activated、state_selected、state_pressed、state_focused 说明 [英] Explanation of state_activated, state_selected, state_pressed, state_focused for ListView
本文介绍了ListView 的 state_activated、state_selected、state_pressed、state_focused 说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以解释(或指向一个解释的链接)ListView 项目的 state_activated、state_selected、state_pressed 和 state_focused 之间的区别吗?它们都是 ListViews 的有效状态吗?是否使用触摸或键盘是否重要?此链接似乎不再有效.
Can anyone explain (or point me to a link that explains) the difference between state_activated, state_selected, state_pressed, and state_focused for ListView items? Are they all valid states for ListViews? Does it matter if touch or a keyboard are being used? This link no longer seems to be valid.
非常感谢!
推荐答案
state_selected
用于使用键盘/dpad/轨迹球/等.state_activated
在调用 View.setActivated(true) 时使用.这用于持久选择"(请参阅平板电脑上的设置以了解实例)state_pressed
在用户按下项目时使用通过触摸或键盘或鼠标state_focused
如果项目被标记为可聚焦并且它接收到通过键盘/dpad/轨迹球/等的用户聚焦.或者如果该项目在触摸模式下可聚焦state_selected
is used when an item is selected using a keyboard/dpad/trackball/etc.state_activated
is used when View.setActivated(true) is called. This is used for "persistent selection" (see Settings on tablet for instance)state_pressed
is used when the user is pressing the item either through touch or a keyboard or a mousestate_focused
is used if the item is marked focusable and it receives focus either through the user of a keyboard/dpad/trackball/etc. or if the item is focusable in touch mode
这篇关于ListView 的 state_activated、state_selected、state_pressed、state_focused 说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文