मैं अपने राज्य के आधार पर एक टेक्स्ट व्यू शैली को बदलने की कोशिश कर रहा हूं। मेरे styles.xml शामिल हैं:टेक्स्ट व्यू state_pressed/state_focused/state_selected शैली परिवर्तन
<style name="text_normal_ops">
<item name="android:gravity">left</item>
<item name="android:textColor">@color/text_usual_color</item>
<item name="android:textStyle">bold</item>
</style>
<style name="text_normal_ops_pressed">
<item name="android:gravity">left</item>
<item name="android:textColor">@color/text_pressed</item>
<item name="android:textStyle">bold</item>
</style>
मेरे चयनकर्ता (text_ops.xml
) के रूप में परिभाषित किया गया है:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" style="@style/text_normal_ops_pressed" />
<item android:state_focused="true" style="@style/text_normal_ops_pressed" />
<item android:state_selected="true" style="@style/text_normal_ops_pressed" />
<item style="@style/text_normal_ops"/>
</selector>
लेकिन जब मैं अपने TextView (style="@drawable/text_ops"
) को यह लागू यह काम नहीं करता। कोई सुझाव?
धन्यवाद
आप रखा है> मूल्य फ़ोल्डर ??? – Hanry
हाँ मुझे हनी है। – trenpixster