Skip to content Skip to sidebar Skip to footer

Centering Radiobutton Views

The layout file

Solution 1:

Okay, so sad news, the RadioButton class is actually hard-coded that the radio drawable will be aligned to the left. The only solution I've found is to subclass RadioButton and handle positioning a Drawable on your own.

Here's an alternate solution (without using RadioGroup at all)

Solution 2:

<stylename="TextlessRadioButton"parent="android:Widget.Material.CompoundButton.RadioButton"><itemname="android:button">@null</item><itemname="android:foreground">?android:listChoiceIndicatorSingle</item><itemname="android:foregroundGravity">center</item></style>

Post a Comment for "Centering Radiobutton Views"