android-segmentedradiobutton icon indicating copy to clipboard operation
android-segmentedradiobutton copied to clipboard

Problems when adding RadioButtons from code

Open joshas opened this issue 14 years ago • 3 comments

When adding RadioButton from code, newly created RadioButtons are not styled correctly.

joshas avatar Nov 26 '11 16:11 joshas

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

vinc3m1 avatar Dec 02 '11 20:12 vinc3m1

Even I am facing the same problem. Any workarounds?

raeesaa avatar May 31 '13 07:05 raeesaa

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

tbrn avatar Jun 19 '13 11:06 tbrn