In meiner Anwendung, ich versuche es in verschiedenen Schnitten values-21
Ordner android:Theme.Material
als Elternteil Thema zu implementieren:Wie benutze ich android: Theme.Material (Material theme) in styles.xml android?
<!-- res/values-21/styles.xml -->
<resources>
<!-- your theme inherits from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- theme customizations -->
<item name="android:colorPrimary">@color/primary</item>
<item name="android:textColorPrimary">@color/text_primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
<item name="android:navigationBarColor">@color/primary_dark</item>
</style>
</resources>
Nach der App ausgeführt wird, erhalte ich Ordner unter error
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
In Werten. Ich habe unten Stil
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
</style>
Aber, wenn ich die gleichen Theme.AppCompat.Light
in values-21 folder
seine adaequat hinzufügen. aber actionbar color
ändert sich nicht.
Warum kann ich das Materialdesignthema in values-21 folder
nicht verwenden? Wie löst man dieses Problem?
(Anmerkung: meine Anwendung minsdk verison
ist 13
und maxsdk version
22
ist)
Meine Tätigkeit AppCompactActivity
Sie können appcompat für dieses –
verwenden @SandeepSingh ich auch bin mit appcompat. Welchen Appcampat brauche ich? – John
sollten Sie ApcompatActivity anstelle von ActionBarActivity oder Activity verwenden, wenn Sie 22.1.1 Build-Version verwenden – Chandru