Keine änderung der Appcompat Thema von Licht, holo dark
Ich versuche mich zu ändern das Thema meiner app komplett, Das ist, was ich geändert & ausprobiert :
styles.xml
im Ordner Werte ist
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
Werte-v11 styles.xml
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
Werte-v14 styles.xml
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
Mainifest.xml
<application
.....
android:theme="@style/AppTheme" >
.......
</application>
Ich bin mit ActionBarActivity
& appcompat_v7
aber die app stürzt von java.lang.RuntimeException: Unable to start activity ComponentInfo{com...}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity
Bin ich etwas fehlt...?
Wie kann ich dieses problem lösen?
Bitte um Hilfe...
Vielen Dank im Voraus !
EDIT: Bei der Verwendung Appcompat Thema , das Thema war Licht, war der code:
So, mit appcompat Thema meine styles.xml
im Ordner Werte war
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
Werte-v11 styles.xml
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
Werte-v14 styles.xml
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
Mainifest.xml
<application
.....
android:theme="@style/AppTheme" >
.......
</application>
Und ich weiß nicht, wie zu ändern appcompat Thema von Licht, holo-dunkel. Bitte helfen Sie
AppCompat
das Thema android:Theme.Holo
ist nicht ein Thema AppCompatschauen Sie bitte meine Frage bearbeitet
InformationsquelleAutor Vivek Warde | 2014-08-06
Du musst angemeldet sein, um einen Kommentar abzugeben.
Als tyczj Spitzen, die Sie verwenden müssen
Theme.AppCompat
als Elternteil für Ihre Themen, wenn Sie Ihre app verwendetappcompat_v7
.Theme.AppCompat
ist optisch die gleiche wieTheme.Holo
(dunkel).Sehen die Artikel über das styling der ActionBar auf die Android-Dokumentation für weitere Informationen.
Sie verwendet
Theme.AppCompat.Light
undTheme.AppCompat.Light.DarkActionBar
. Haben Sie versucht, nurTheme.AppCompat
? Ich benutze es in der app, die ich entwickle, die verwendetappcompat_v7
auch, und es ist definitiv dunkel.InformationsquelleAutor nstCactus