android-segmentedradiobutton
android-segmentedradiobutton copied to clipboard
Problems when adding RadioButtons from code
When adding RadioButton from code, newly created RadioButtons are not styled correctly.
I haven't tried it, but I think you need to make sure you provide all the styling properties defined in main.xml
https://github.com/makeramen/android-segmentedradiobutton/blob/master/res/layout/main.xml
Even I am facing the same problem. Any workarounds?
Hi guys, there's a workaround for this.
I've overriden addView in the SegmentedRadioGroup class which calls super and then call changeButtonsImages(): @Override public void addView(View child) { super.addView(child); changeButtonsImages(); }
I've also created a style for buttons which I use when creating new buttons: new RadioButton(getActivity(), null, R.style.MyRadioButtonStyle);
Sorry my formatting, I'm new to github, just registered to post this and maybe help someone. Cheers