मैं एंड्रॉइड ओवरराइड नहीं कर सकता: switchStyle। यहाँ मैं क्या किया है है:Android स्विच में स्टाइल स्विच स्टाइल और नंबरपिकर ओवरराइड करने में असमर्थ
themes.xml:
<style name="AppTheme" parent="android:Theme.Holo.Light">
<item name="android:switchStyle">@style/SwitchAppTheme</item>
</style>
styles.xml:
<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>
मैं
फ़ोल्डर मान-v14 में, मैं दो फ़ाइलें निम्नलिखित त्रुटियां मिली हैं:
res/values-v14/styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.CompoundButton.Switch'.
res/values-v14/themes.xml:5: error: Error: No resource found that matches the given name: attr 'android:switchStyle'.
मैं NumberPicker साथ एक ही समस्या है:
themes.xml:
<item name="android:numberPickerUpButtonStyle">@style/NumberPickerButtonUpAppTheme</item>
<item name="android:numberPickerDownButtonStyle">@style/NumberPickerButtonDownAppTheme</item>
<item name="android:numberPickerStyle">@style/NumberPickerAppTheme</item>
styles.xml:
<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>
मैं निम्नलिखित त्रुटियाँ हैं:
/res/values-v11/themes.xml:26: error: Error: No resource found that matches the given name: attr 'android:numberPickerStyle'.
/res/values-v11/themes.xml:25: error: Error: No resource found that matches the given name: attr 'android:numberPickerDownButtonStyle'.
/res/values-v11/themes.xml:25: error: Error: No resource found that matches the given name: attr 'android:numberPickerUpButtonStyle'.
मेरा प्रोजेक्ट एसडीके 16 का उपयोग करता है, इसलिए यह उपलब्ध होना चाहिए ... ग्रहण और IntelliJ में एक ही त्रुटि।
इन शैलियों का विस्तार कैसे करें? मैं कई अन्य लोगों (बटन स्टाइल, बटन स्टाइल टॉगल, seekBarStyle ...) को उसी तरह बढ़ा सकता हूं ...
एक ही सटीक मुद्दे में भागो। ऐसा लगता है कि यह Google बग के रूप में भी रिपोर्ट किया गया था। http://code.google.com/p/android/issues/detail?id=36636 –
हां, मैंने बग बनाया है क्योंकि मुझे पूरा यकीन है कि मैंने कोई गलती नहीं की है, लेकिन मैंने यह पोस्ट भी बनाया है किसी के मामले में कोई विचार है ... –
आप दस्तावेज़ों पर android.R.attr को देख कर सार्वजनिक विशेषताओं की जांच कर सकते हैं। –