How to change Radiobutton text color in android

How to set any color combination to Radio button item text color using xml.

Radio button text color are the item text color of radio button name. This text can be easily changeable through layout xml file using  android:textColor=” “ attribute on radio button xml file. So here is the complete step by step tutorial for How to change Radiobutton text color in android.

android-project-download-code-button

How to change Radiobutton text color in android.

Code for MainActivity.java file.

package com.radiobuttontextcolor_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.radiobuttontextcolor_android_examples.com.MainActivity" >

 

 <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="RadioButton"
 android:textColor="#00dbfc" />

</RelativeLayout>

Screenshot:

How to change Radiobutton text color in android

Click here to download How to change Radiobutton text color in android project with source code.