--- title: Theming layout: default ---

Theming

Theming of the action bar to work on both pre-3.0 and 3.0+ devices is a very straightforward and simple process. You should follow the existing theming recommendations for customizing the native action bar except for what is noted below.

An example of a customized action bar can be seen in the “Styled” application on the samples page.

Parent Themes

In order for the action bar to function on pre-3.0 devices your activity must use Theme.Sherlock or Theme.Sherlock.Light, or your custom theme must use one of the aforementioned two as its parent.

These two themes serve as baseline configurations for the pre-3.0 action bar as well as mapping the attributes to their native versions on 3.0+.

The themes should be defined in your manifest for the entire application or on a per-activity basis. You may also define the theme in the code of each activity before calling super.onCreate(Bundle). This must be done for every activity on which you extend from FragmentActivity and intend to use the action bar. More information on how to specify a theme can be found in the official Android documentation.

Attributes

ActionBarSherlock themes expose non-namespaced versions of the action bar-related attributes which are used to style various elements. Each attribute has an appropriate default value set in the two parent themes so that you may only override the value you wish to change.

There is also additional attributes which applies only to the pre-3.0 action bar to allow for specific customization that is not available on the native action bar.

With version 3.1 of the library came new attributes directly in the theme to style the various feature of the action bar without using a seperate style.