I don't think so, I ran into the same problem with my code, and I
simply made an onClickListener for every radio button that when
clicked would run a method that set all the radio buttons
to .setChecked(false) and then  the listener would .setChecked(true)
the one they clicked. It's a ghetto way of doing it but it works. I
wish they would fix little things like this. And don't even get me
started on trying to make vertical seekbars...

On Dec 13, 1:24 am, launchpadtt <christopher.yee...@gmail.com> wrote:
> Hello,
>
> I have a bunch of radiobuttons in a radiogroup and I would like for
> them to be arranged in two columns. The reason being so that they fit
> on the screen and so that I can change the columns to be four in
> landscape mode. I thought to intermingle the tablelayout with the
> radiogroup. with the following code:
>
> <TableLayout android:id="@+id/TableLayout01"
> android:layout_height="wrap_content"
> android:layout_width="fill_parent">
>   <RadioGroup android:layout_height="wrap_content" android:id="@+id/
> radiogroupChoices" android:layout_width="fill_parent">
>     <TableRow android:id="@+id/TableRow01"
> android:layout_height="wrap_content"
> android:layout_width="fill_parent">
>       <RadioButton android:layout_height="wrap_content"
> android:text="One" android:id="@+id/RadioButtonOne"
> android:layout_weight="1" android:layout_width="fill_parent"></
> RadioButton>
>       <RadioButton android:layout_height="wrap_content"
> android:text="Two" android:id="@+id/RadioButtonTwo"
> android:layout_width="fill_parent" android:layout_weight="1"></
> RadioButton>
>     </TableRow>
>     <TableRow android:id="@+id/TableRow02"
> android:layout_height="wrap_content"
> android:layout_width="fill_parent">
>       <RadioButton android:layout_height="wrap_content"
> android:text="Three" android:id="@+id/RadioButtonThree"
> android:layout_weight="1" android:layout_width="fill_parent"></
> RadioButton>
>       <RadioButton android:layout_height="wrap_content"
> android:text="Four" android:id="@+id/RadioButtonFour"
> android:layout_weight="1" android:layout_width="fill_parent"></
> RadioButton>
>     </TableRow>
>   </RadioGroup>
> </TableLayout>
>
> In this setup, the radio buttons show up in neat columns but the
> problem is the instant that I do that it takes them out of the
> radiogroup.
>
> I tried leaving them in the TableLayout and just changing the parent
> of the radiobuttons by using radiogroup.addView(eachbutton) but that
> wouldn't work since they were already defined in the xml.
>
> I also tried just having a regular radiogroup with the radiobuttons in
> them and then just changing the orientation to horizontal, so that I
> could set the width programatically based on the screen width
>
> <ScrollView android:layout_width="fill_parent" android:id="@+id/
> scrollviewListHolder" android:layout_height="fill_parent"
> android:layout_weight="1">
>   <RadioGroup android:id="@+id/radiogroupChoices"
> android:layout_width="fill_parent" android:layout_height="fill_parent"
> android:layout_weight="1" android:orientation="horizontal">
>     <RadioButton android:layout_height="wrap_content"
> android:text="One" android:id="@+id/RadioButtonOne"
> android:layout_width="wrap_content"></RadioButton>
>     <RadioButton android:layout_height="wrap_content"
> android:text="Two" android:id="@+id/RadioButtonTwo"
> android:layout_width="wrap_content"></RadioButton>
>   </RadioGroup>
> </ScrollView>
>
> but that wouldn't work either. as many as would fit into one row would
> fit and the rest would be off the screen.
>
> Is there a way to arrange them in such a fashion while still keeping
> them in the radiogroup?

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to