user4813855
user4813855

Reputation:

Remove border RadioButton?

Can I remove border of RadioButton and I have RadioButtons like bellow :

enter image description here

I see a lot of question and I used from android:buttonTint="" and style ... but don't work .

Upvotes: 0

Views: 1426

Answers (3)

gbruscatto
gbruscatto

Reputation: 696

You will need to create a custom radio button to change the style in that way. Read this article if you want to learn how to do it. Good luck.

Upvotes: 0

Dinal Koyani
Dinal Koyani

Reputation: 455

No, you can't remove this.You can custom radio button.

Upvotes: 0

washichi
washichi

Reputation: 100

You can't remove that using the radiobutton. what you can do is set it to the same color as your background, or create a custom radiobutton XML:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="false" 
android:drawable="@drawable/your_radio_off_image_name" />
<item android:state_checked="true" 
android:drawable="@drawable/your_radio_on_image_name" />
</selector>

use that XML in your layout:

<RadioButton
android:id="@+id/radiobutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/custom_radiobutton"/>

more info and examples about custom xml: Adding custom radio buttons in android

remove default radio button checkbox when using a custom selector

Another option is to use a toggle instead of radiobutton, and just change the drawable onToggle.

Upvotes: 1

Related Questions