Android Action Bar Style Generator : Change text color of action bar not available?

你离开我真会死。 提交于 2019-12-25 05:52:39

问题


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 ?

http://jgilfelt.github.io/android-actionbarstylegenerator/#name=RoseNormal&compat=holo&theme=light&actionbarstyle=solid&texture=0&hairline=0&neutralPressed=1&backColor=e64260%2C100&secondaryColor=b8344c%2C100&tabColor=fff%2C100&tertiaryColor=F2F2F2%2C100&accentColor=33B5E5%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100


回答1:


you can use this:

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);
    }
}

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



来源:https://stackoverflow.com/questions/24464727/android-action-bar-style-generator-change-text-color-of-action-bar-not-availab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!