Android的动作栏样式生成器:行动吧不可更改文本颜色? [英] Android Action Bar Style Generator : Change text color of action bar not available?
问题描述
我用Android的动作栏样式生成器的网站,以产生样式我的动作条。
I use "Android Action Bar Style Generator" website to generate styles for my actionBar.
有没有可能改变动作条的文本颜色?
There is no possibility to change the text color of actionBar ?
<一个href="http://jgilfelt.github.io/android-actionbarstylegenerator/#name=RoseNormal&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutral$p$pssed=1&backColor=e64260%2C100&secondaryColor=b8344c%2C100&tabColor=fff%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100" rel="nofollow">http://jgilfelt.github.io/android-actionbarstylegenerator/#name=RoseNormal&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutral$p$pssed=1&backColor=e64260%2C100&secondaryColor=b8344c%2C100&tabColor=fff%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100
推荐答案
您可以使用此:
int actionBarTitleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
if (actionBarTitleId > 0) {
TextView title = (TextView) findViewById(actionBarTitleId);
if (title != null) {
title.setTextColor(Color.RED);
}
}
获得的TextView
的ID对<code>动作条(actionBarTitleId),那么你什么都想要。改变大小,颜色和......
get id of textView
on Actionbar
( actionBarTitleId ) then do what ever you want. change size, color and ....
如果你想使用的风格和更多信息请参见这个主题
if you want use style and for more info see This Thread
这篇关于Android的动作栏样式生成器:行动吧不可更改文本颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!