我无法覆盖
android:switchStyle.这就是我所做的:
@H_404_2@在文件夹值-v14中,我有两个文件:
@H_404_2@themes.xml:
@H_404_2@styles.xml:
- <style name="AppTheme" parent="android:Theme.Holo.Light">
- <item name="android:switchStyle">@style/SwitchAppTheme</item>
- </style>
@H_404_2@我有以下错误:
- <style name="SwitchAppTheme" parent="android:Widget.Holo.Light.CompoundButton.Switch">
- <item name="android:track">@drawable/switch_track_holo_light</item>
- <item name="android:thumb">@drawable/switch_inner_holo_light</item>
- </style>
@H_404_2@res/values-v14/styles.xml:4: error: Error retrieving parent for item:@H_404_2@我对NumberPicker有同样的问题: @H_404_2@themes.xml:
No resource found that matches the given name
‘android:Widget.Holo.Light.CompoundButton.Switch’. @H_404_2@res/values-v14/themes.xml:5: error: Error: No resource found that
matches the given name: attr ‘android:switchStyle’.
@H_404_2@styles.xml:
- <item name="android:numberPickerUpButtonStyle">@style/NumberPickerButtonUpAppTheme</item>
- <item name="android:numberPickerDownButtonStyle">@style/NumberPickerButtonDownAppTheme</item>
- <item name="android:numberPickerStyle">@style/NumberPickerAppTheme</item>
@H_404_2@我有以下错误:
- <style name="NumberPickerButtonUpAppTheme" parent="android:Widget.Holo.Light.ImageButton.NumberPickerUpButton">
- <item name="android:src">@drawable/numberpicker_up_btn_holo_light</item>
- </style>
- <style name="NumberPickerButtonDownAppTheme" parent="android:Widget.Holo.Light.ImageButton.NumberPickerDownButton">
- <item name="android:src">@drawable/numberpicker_down_btn_holo_light</item>
- </style>
@H_404_2@/res/values-v11/themes.xml:26: error: Error: No resource found that@H_404_2@我的项目使用SDK 16,因此它应该可用…在eclipse和IntelliJ中出现相同的错误. @H_404_2@如何扩展这些风格?我可以用同样的方式扩展许多其他的(buttonStyle,buttonStyleToggle,seekBarStyle ……)
matches the given name: attr ‘android:numberPickerStyle’. @H_404_2@/res/values-v11/themes.xml:25: error: Error: No resource found that
matches the given name: attr ‘android:numberPickerDownButtonStyle’. @H_404_2@/res/values-v11/themes.xml:25: error: Error: No resource found that
matches the given name: attr ‘android:numberPickerUpButtonStyle’.
解决方法
Switch小部件的样式不公开.
@H_404_2@您可以使用android-switch-backport或SwitchCompatLibrary.
他们也与Android Holo Colors合作 @H_404_2@数字选择器还有另一种选择:Better Pickers @H_404_2@我希望我能提供帮助.
他们也与Android Holo Colors合作 @H_404_2@数字选择器还有另一种选择:Better Pickers @H_404_2@我希望我能提供帮助.