How to set title color in ActionBarSherlock?

前端 未结 5 689
余生分开走
余生分开走 2020-12-14 20:30

How to set title color in ActionBarSherlock?

Which theming attributes should I use?

5条回答
  •  庸人自扰
    2020-12-14 21:06

    you can do it from 2 places either in style.xml or programatically
    1.From style.xml

    2.Or in code

    int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");  
    TextView yourTextView = (TextView)findViewById(titleId);
    yourTextView.setTextColor(getResources().getColor(R.color.myColor));
    

    Or using actionbar you can also achieve this

    getSupportActionBar().setTitle(Html.fromHtml("App Name"));
    

提交回复
热议问题