问题
I have an app that is minSDK 10, target's 14. I'd love to use the Light.Holo Theme (if available for device--and falls back to light theme for older device). Is there a way I can do this this?
It seems it defaults to Dark.Holo when you target 14, but when I try to add any other theme, it overwrites it and makes it look older on newer devices.
回答1:
You need to provide separate styles for both platforms to ensure that the correct style will be found at runtime.
In your res/values/styles.xml file, create the following style:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyTheme" parent="@android:style/Theme.Light" />
</resources>
In your res/values-v11/styles.xml file, create the following style:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyTheme" parent="@android:style/Theme.Holo.Light" />
</resources>
In your AndroidManifest.xml file, use the following line for your application's theme:
android:theme="@style/Theme.MyTheme"
回答2:
I think these answers might fit: Set Holo theme in older Android versions?
Basically they're recommending copying the themes into your own project so they're available to all users
来源:https://stackoverflow.com/questions/11146424/android-how-to-handle-theming-for-older-sdks