Search code examples
androidandroid-actionbarandroid-tabsandroid-styles

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


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


Solution

  • 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