Mohamed Jihed Jaouadi
Mohamed Jihed Jaouadi

Reputation: 1517

How to make a RadioButon without text?

I just want a simple RadioBttun without text and I did the code below but what I get is a radiobutton widget with little space that is I think reserved to the text. So How should get rid of this space ?

<RadioButton
    android:id="@+id/rb_topup_item_account_selection_status"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@null" />

enter image description here

Upvotes: 12

Views: 2536

Answers (1)

Rupam Das
Rupam Das

Reputation: 483

Just add the below attributes to the RadioButton element in your XML layout. It will remove the default padding.

android:minWidth="0dp"
android:minHeight="0dp"

Upvotes: 27

Related Questions