state_activated pre honeycomb

半城伤御伤魂 提交于 2020-01-14 07:41:11

问题


How do you use

<item android:drawable="@drawable/ic_launcher" android:state_activated="true"/>

for list view items in an apps that should also run on devices <11 ?

Since activated_state is not available before HC, I can only think of two dirty workarounds:

  1. Maintain the activated_state manually in your Activity.
  2. Maintain the activated element in my custom ListAdapter

But either one is satisfying. (getListView().setChoiceMode(...) wouldn't have an effect,...)

Any other ideas?


回答1:


have you had a look to this tutorial ?

http://mobile.tutsplus.com/tutorials/android/android-compatibility-list-indicators-on-honeycomb/



来源:https://stackoverflow.com/questions/11748615/state-activated-pre-honeycomb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!