私は 2 つの styles.xml:s を作成しました。1 つは値で、もう 1 つは values-v11 です。
/res/values/styles.xml
<resources>
<style name="appTheme" parent="@android:style/Theme.Light"> </style>
</resources>
/res/values-v11/styles.xml
<resources>
<style name="appTheme" parent="@android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:background">#3b5998</item>
</style>
</resources>
AndroidManifesr.xml
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/pic"
android:label="@string/app_name"
android:theme="@style/appTheme"
>
Android 4.2 デバイスでこのプログラムを実行すると、アクション バーが消えるため、4.2 デバイスも /res/values/styles.xml に移動してスタイルを取得すると思います。それで、私は何を間違っていますか?
編集!/res/values-v11/styles.xmlparent="android:Theme.Holo.Light.DarkActionBar"
で、「MyActionBar」スタイルがparent="@android:style/Widget.Holo.ActionBar"
またはparent="@android:style/Widget.Holo.Light.ActionBar"