How to change action bar title color in code

前端 未结 6 1279
陌清茗
陌清茗 2020-11-27 05:28

I\'m having trouble changing androids action bar title color programmatically for v11 and up. I can get it done in xml but need to change it dynamically in code. How should

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 06:03

    If you use Sherlock Actionbar you may use the sherlock-actionbar-id for supported actionbars (Android below 3.0)

    int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");    
    if ( 0 == titleId ) 
            titleId = com.actionbarsherlock.R.id.abs__action_bar_title;
    

提交回复
热议问题