android:actionBarStyle requires API level 11

Another option is to use the tools:targetApi attribute, which requires the tools namespace. This acts in a similar fashion to the @TargetApi annotation you can use in java files.

<resources xmlns:tools="http://schemas.android.com/tools">

<style name="MyThemes.MyTheme">
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
    <item name="android:actionBarStyle" tools:targetApi="11">@style/Widget.Styled.ActionBar</item>
</style>

</resources>

Note the xmlns:tools="http://schemas.android.com/tools" in the <resources> tag, as it is required.

Leave a Comment