Remove/Hide Radio Button circle in android

How to make radio button without its selection circle rounded icon in android app.

In this tutorial we are creating radio buttons without rounded circle selection icon where user show its selection by pointing a small round black dot inside it .Radio button circle can be hide through android:button=”@null” attribute tag. So here is the complete step by step tutorial for Remove/Hide Radio Button circle in android.

android-project-download-code-button

How to Remove/Hide Radio Button circle in android.

Code for MainActivity.java file.

 package com.hideradiobuttoncircle_android_examples.com;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 }

}

Code for activity_main.xml layout file.

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context="com.hideradiobuttoncircle_android_examples.com.MainActivity" >

 <RadioGroup
 android:id="@+id/radiogroup"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:orientation="vertical"
 android:layout_centerVertical="true"
 android:layout_centerHorizontal="true" >
 <RadioButton
 android:id="@+id/radioButton1"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_centerHorizontal="true"
 android:layout_centerVertical="true"
 android:text="Android"
 android:button="@null"
 android:layout_margin="15dp" />

 <RadioButton
 android:id="@+id/radioButton2"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignLeft="@+id/radioButton1"
 android:layout_below="@+id/radioButton1"
 android:text="PHP"
 android:button="@null"
 android:layout_margin="15dp" />

 <RadioButton
 android:id="@+id/radioButton3"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignLeft="@+id/radioButton2"
 android:layout_below="@+id/radioButton2"
 android:text="Blogger"
 android:button="@null"
 android:layout_margin="15dp" />
</RadioGroup>
</RelativeLayout>

Screenshot:

Remove/Hide Radio Button circle in android

Click here to download Remove/Hide Radio Button circle in android project with source code.

Leave a Reply

Your email address will not be published. Required fields are marked *