How do I apply the HoloEverywhere android theme when using ActionBarSherlock?

时间秒杀一切 提交于 2019-12-02 20:59:24

To enable the Holo theme by default for every ListView I went in the styles.xml file of the HoloEverywhere library then I modified the "ListViewStyle" element by adding this line :

<item name="android:listSelector">@drawable/list_selector_holo_dark</item>

I had the same issue with ListView's selector. I though that HoloEveruwhere would apply holo selector(blue) by default(I have tried both Theme.HoloEverywhereLight and Theme.HoloEverywhereLight), but it didn't. Maybe I am missing something.

I ended up setting the selector manually:

listView.setSelector(R.drawable.list_selector_holo_light);

You have several drawable resources in the library you can make use of(list_selector_holo_light for example).

A portable and correct solution would be to inherit from ListViewStyle and override the attribute, making this in your styles.xml.

If you had HoloEverywhere official library deployed remotely on a server (e.g. Maven repo) you could not depend on it mantaining a change in the styles.xml (you are modifying it for your own needs).

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