我正在构建一个应该在 android 2.3 上运行的应用程序,并且我添加了 ActionBarSherlock 和 HoloEverywhere 库。
为了使用 ActionBarSherlock,我必须像这样使用 Theme.Sherlock:
<application
...
android:theme="@style/Theme.Sherlock"
... >
没关系。
我的主要 Activity 非常简单:只有一个 5 行的 ListView(我不使用 ListAcivity)。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/menuListView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
因为是android 2.3,我还是有orange&black的主题(当然ActionBar除外)。现在我想通过像这样修改我的 list 来添加 HoloEverywhere 主题:
<application
...
android:theme="@style/Theme.HoloEverywhereDark.Sherlock"
... >
但这并没有改变任何东西......我错过了什么?
最佳答案
为了默认为每个 ListView 启用 Holo 主题,我进入了 HoloEverywhere 库的 styles.xml 文件,然后通过添加以下行修改了“ListViewStyle”元素:
<item name="android:listSelector">@drawable/list_selector_holo_dark</item>
关于android - 使用 ActionBarSherlock 时如何应用 HoloEverywhere android 主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11682762/