Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Problems when adding RadioButtons from code #3

Open
joshas opened this issue Nov 26, 2011 · 3 comments
Open

Problems when adding RadioButtons from code #3

joshas opened this issue Nov 26, 2011 · 3 comments

Comments

@joshas
Copy link

joshas commented Nov 26, 2011

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

@vinc3m1
Copy link
Owner

vinc3m1 commented Dec 2, 2011

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

@raeesaa
Copy link

raeesaa commented May 31, 2013

Even I am facing the same problem. Any workarounds?

@tbrn
Copy link

tbrn commented Jun 19, 2013

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants