MinSDKVersion = 7 TargetSDKVersion = 17Android: Jak korzystać z różnych motywów dla różnych wersji Androida?
Jeśli użytkownik posiada SDKVersion 11 lub wyższy Chciałbym ustawić motyw do Theme.Holo.Light. To nie działa dla mnie tutaj. Kiedy uruchomić aplikację na urządzeniu 3.1 to po prostu wykorzystuje Theme.Light:
samo kiedy uruchomić tę aplikację na urządzeniu z wersji niższej niż 3.1
My Folderstructure:
Oczywisty:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme" >
Wartości-v11:
<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:style/Theme.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="@android:style/Theme.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
innymi wartościami foldery:
<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:style/Theme.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="@android:style/Theme.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="MyTheme" parent="@android:style/Theme.Light">
<!-- Any customizations for your app running on devices with Theme.Holo here -->
</style>
Jak mogę wykorzystać to poprawnie?
poważaniem Marco Seiz
zrobiłem to, ale nadal wykazały stary temat i nie Tematem holo na moim Androidzie 4.1 i 3.1 urządzenia –
Czy usunąć powielania? – Ahmad
Tak, zrobiłem. Zrozumiałem błąd. Musiałem stworzyć dwa foldery dla jednego języka. Dla języka niemieckiego: values-de AND values-de-v11 i to samo dla języka angielskiego ... Działa teraz :) Dzięki za pomoc i wskazówki! –