动作条的文字颜色 [英] ActionBar text color

查看:146
本文介绍了动作条的文字颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能改变动作条的文本颜色?我继承了全息光的主题,我能够改变的ActionBar的背景,但我没有发现什么是调整来改变文字颜色的属性。

how can I change the text color of the ActionBar? I've inherited the Holo Light Theme, I'm able to change the background of the ActionBar but I don't find out what is the attribute to tweak to change the text color.

好吧,我可以改变文字颜色属性机器人:textColorPrimary但它也改变了下拉菜单中的文字时显示的颜色有溢出发生在动作条按钮。任何想法如何改变那些下拉菜单/列表的颜色?

Ok, I'm able to change the text color with the attribute android:textColorPrimary but it also changes the text color of the dropdown menu displayed when an overflow happen on the ActionBar buttons. Any idea how to change the color of those dropdown menu / List ?

推荐答案

好吧,我已经找到了一个更好的办法。我现在只能够更改标题的颜色。您也可以调整字幕。

Ok, I've found a better way. I'm now able to only change the color of the title. You can also tweak the subtitle.

这是我的styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyTheme.ActionBarStyle</item>
  </style>

  <style name="MyTheme.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
  </style>

  <style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@color/red</item>
  </style>
</resources>

这篇关于动作条的文字颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆