• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to align radio button groups

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have several radio button groups,But when i run my code it doesn't align correctly.I ned to have all radion buttons align same vertical line.

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
still i have issue.please can anyone tell me how to do this?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to post a screenshot of what the layout currently looks like, otherwise it's hard to imagine what might need to be changed.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
atatched the screenshot
radio.png
[Thumbnail for radio.png]
attached
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no way easy way to avoid this, since the LinearLayouts are independent of each other. You should use a TableLayout instead.
 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ulf.
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A TableLayout is fine for the Checkboxes you are actually using. The post and question mention RadioButtons, which are supposed to be mutually exclusive, but only get that way when you put them in RadioGroups. RadioGroups, unfortunately, are derived from LinearLayout (rather than being a non-layout control group). So if you do need the mutual exclusion of RadioButtons and RadioGroups like the question asks (but not what the code or screenshot shows) then you need to either use weights to size your text and buttons, or use a TableLayout and manage the exclusive checking yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic