How do I change the background color of the ActionBar of an ActionBarActivity using XML?

后端 未结 20 2702
我寻月下人不归
我寻月下人不归 2020-11-22 01:09

Details:

I\'m extending ActionBarActivity.
Eclipse and SDK fully patched as of 2011-11-06.



        
相关标签:
20条回答
  • 2020-11-22 02:08

    try this:

    ActionBar bar = getActionBar();
    bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#0000ff")));
    
    0 讨论(0)
  • 2020-11-22 02:11

    try one line code :

    getActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.MainColor)));
    
    0 讨论(0)
提交回复
热议问题