में लागू नहीं हो रहा है, मैं कस्टम चेकबॉक्स और रेडियो बटन विकसित कर रहा हूं लेकिन शैली पूर्व लॉलीपॉप डिवाइसों (इसके बजाय काले रंग दिखा रहा है) दोनों के लिए आवेदन नहीं कर रही है। मैं इस तरह से कोडित हैस्टाइल कस्टम चेकबॉक्स और रेडियोधटन
एक्सएमएल:
<com.kaho.myapp.CustomCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBoxText"
android:textColor="@color/colorPrimary"
android:theme="@style/SampleTheme"/>
कस्टम चेकबॉक्स: ठीक से स्थापित करने में
public class CustomCheckBox extends CheckBox {
public CustomCheckBox(Context context) {
super(context);
}
public CustomCheckBox(Context context, AttributeSet attrs) {
super(context, attrs);
setFont(context, attrs) ;
}
public CustomCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
setFont(context,attrs) ;
}
public CustomCheckBox(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setFont(context, attrs) ;
}
private void setFont(Context context, AttributeSet attrs) {
if (attrs != null) {
/* Set the font */
}
}
}
फ़ॉन्ट। शैली:
<style name="SampleTheme" parent="Theme.AppCompat.Light">
<item name="colorAccent">#08c283</item>
<item name="android:textColorSecondary">#969696</item>
</style>
धन्यवाद यह काम कर रहा है ... – Nikesh