【问题标题】:Android actionbar NavMode.Tabs how to change highlight color?Android actionbar NavMode.Tabs 如何改变高亮颜色?
【发布时间】:2013-09-17 08:38:25
【问题描述】:

我没有使用 Tabhost(我也不想),我已经尝试了所有方法:

这是我的操作栏,我正在使用全息灯和深色操作栏

actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

我尝试使用这个有用的网站但没有成功。

我也尝试过失败

actionBar.setStackedBackgroundDrawable(new      ColorDrawable(getResources().getColor(R.color.color_brown_dark)));

这是我的styles.xml

 <style name="AppBaseTheme" parent="android:Theme.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
    <item name="android:actionBarStyle">@style/Lemonbar</item>
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->

</style>

Lemonbar 是覆盖 Theme.Holo.Light.DarkActionBar 的样式,它是使用 android 动作栏样式生成器创建的。 当我启动应用程序时,操作栏仍然和以前一样,就像没有应用新样式一样

【问题讨论】:

    标签: android android-layout android-actionbar


    【解决方案1】:

    尝试为此使用google guide

    【讨论】:

    • 我做到了,我只得到一个白色的操作栏。我需要一个深色的,深色操作栏的xml代码是什么?我的意思是 Holo.light.DarkActionBar 什么的
    • @codareee 和你写的一样developer.android.com/training/basics/actionbar/… 用你想要的就行了
    • 谢谢。我不知道为什么,但我在写它时遇到了错误。仍在尝试解决问题中的问题。
    • @codareee 那么标签样式有什么问题吗?指南中的 XML 代码没有提供答案吗?
    • @codareee 你只有一个styles.xml吗?因为通常 Eclipse 会针对不同的 Android 版本自动生成其中的 3 或 4 个。因此,如果您在使用 v.4 的设备上进行测试并编辑 style.xml 不是在 values-v14 文件夹中,而是在普通的 values 中,您将看不到效果,因为这些值被更高的配置文件覆盖。
    【解决方案2】:

    它被称为标签指示器。你们很多人都觉得这个android's develop guide 很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-04
      • 1970-01-01
      • 1970-01-01
      • 2015-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多