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

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

Details:

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



        
20条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 01:50

    As per documentation - "You can control the behaviors and visibility of the action bar with the ActionBar APIs, which were added in Android 3.0 (API level 11)."

    So, ActionBar will not work for your target environment which is at API level 10 (Android 2.3.3).

    Just in case, if you target for minimum API level 11 , you can change ActionBar's background color by defining custom style, as:

    
        
    
        
    
    

    And, set "MyTheme" as theme for application / activity.

提交回复
热议问题