In my code, I add input elements like radioButtons, checkboxes etc to my Layout programmatically. The problem is, that the style of those elements is not the default style t
You can pass a style defined inside styles.xml as an argument of a View constructor. So considering your example, you would have to call:
RadioButton radioButton = new RadioButton(mContext, null, R.attr.radioButtonStyle);
then add custom attribute inside attrs.xml
and inside your application theme in styles.xml add
- @style/YourRadioButtonStyle
YourRadioButtonStyle is custom radio button style defined in styles.xml