如何设置标题颜色ActionBarSherlock? [英] How to set title color in ActionBarSherlock?

查看:109
本文介绍了如何设置标题颜色ActionBarSherlock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置标题颜色 ActionBarSherlock

这主题化属性,我应该使用?

Which theming attributes should I use?

推荐答案

ActionBarSherlock网站

父主题

为了自定义操作栏执行功能的应用程序必须使用Theme.Sherlock,Theme.Sherlock.Light,或Theme.Sherlock.Light.DarkActionBar,或自定义主题必须使用上述作为其父之一。

In order for the custom action bar implementation to function your application must use Theme.Sherlock, Theme.Sherlock.Light, or Theme.Sherlock.Light.DarkActionBar, or your custom theme must use one of the aforementioned as its parent.

镜像属性

由于Android的主题化系统限制任何自定义主题,必须在两个属性声明。正常android- prefixed属性应用主题本机操作栏和pfixed联合国$ P $属性的自定义实现...

Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation...

总之,这意味着你需要离开了机器人: preFIX当你造型的动作条

In short, that means you need to leave out the android: prefix when you're styling the ActionBar.

主题化的标题颜色

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

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

<style name="YOURTHEME.ActionBar.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
<item name="android:textColor">@color/YOUR_COLOR</item>
<item name="textColor">@color/YOUR_COLOR</item>
</style>
</resources>

注意

我没有测试过这一点。此外,你尝试过什么?你应该张贴的SO 的未来。

I haven't tested this. Also, what have you tried? You should searching before posting on SO in the future.

这篇关于如何设置标题颜色ActionBarSherlock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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