I’d like to create a custom View which contains a RadioGroup. Inside of the RadioGroup I’d like the RadioButtons to be set up so that the first RadioButton is at the top left, the 2nd one is below that, the third to the right of the 1st one and the 4th one underneath that. In other words, I want to create a group where the radiobuttons are laid out in a square of sorts. I think if I set the orientation of the group to be vertical, then all the radiobuttons will be in a straight line. If, on the other hand, I set the orientation to horizontal, then, again, the radiobuttons will all be in a straight line, going horizontal. Is there a way to do what I want or am I forced to set up two separate RadioGroups, both to horizontal orientation?
I’d like to create a custom View which contains a RadioGroup . Inside of
Share
Try processing the
RadioButtonswithout the use ofRadioGroup.Wire-up the individual
RadioButtonsand hold them in anArrayList<RadioButton>.Set an
OnCheckedChangeListenerfor eachRadioButton.Then create a method to uncheck the unselected
RadioButtons.Using this approach, the
RadioButtonscan be located anywhere within the XML layout.