Is this correct behaviour for a RadioButton? It’s ...
# android
l
Is this correct behaviour for a RadioButton? It’s not centred within its view boundaries, so when we add a TextView next to it there’s too much space
Inspected all its attributes in the layout inspector and can’t see where it’s coming from
h
Use the Force, Luke!
(Sorry, not very helpful, I know ... I just couldn't resist)
p
Set the dimensions to wrap content
v
It is normal for default RadioButton with no text set to it. Unfortunately, even if you set empty text to it it won’t change its size to become centered. If you want to have a centered RadioButton I would suggest such hack (just set the size you need for your app):
Copy code
<RadioButton
    android:id="@+id/radioButton"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:background="?android:attr/listChoiceIndicatorSingle"
    android:button="@null" />
It will produce centered RadioButton
p
Or remove the min size