android - 使用 ActionBarSherlock 时如何应用 HoloEverywhere android 主题?

标签 android android-actionbar actionbarsherlock android-theme android-holo-everywhere

我正在构建一个应该在 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/

相关文章:

java - 如何禁用Java,Android中的所有按钮

java - Android 相机的问题

java - 显示 AlertDialog 而不隐藏 ActionBar

android - 用滑动抽屉覆盖 ActionBar

android - ActionBarSherlock 在下拉导航微调器上显示错误的颜色和单选按钮

android - 如何在android中创建流体运动

Android Gradle 构建失败 - Java 以非零退出 2 完成

android - Xamarin - 在操作栏中添加标题和按钮

android - 如何使用 ActionBarSherlock 4.2.0 在我的项目中导入 SlidingMenu

android - 如何将 Robolectric、Maven、ActionBarSherlock(最好是 + IntelliJ)集成到 Android 项目中?