In android, I can apply a custom style based on versions:
+-res/values-v14/styles.xml
+-res/values/styles.xml
but, how can I apply a defined style based on version?
in values/styles.xml:
<style name="spinner_textview">
<item name="style">@android:style/Widget.Spinner></item>
</style>
the following line causes error in eclipse
<item name="style">@android:style/Widget.Spinner</item>
Eclipse says: No resource found that matches the given name: attr
‘style’.
is there a way that I can apply style based on api version?
PS: i’m try to apply @android:style/Widget.DeviceDefault.Spinner to a TextView, but the style is only available in api 14+;
You are trying to specify the style within a style declaration.
Instead, your style should have “@android:style/Widget.Spinner” as it’s parent to inherit all it’s attributes.
This same style should have different parents depending on the version ( by using the values-XX folders )