0

I cant change the text color in my radiobutton:

  <RadioGroup
                        android:gravity="center"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:color = "#000000"
                    >

                        <RadioButton 
                            android:id="@+id/contact_yes"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:color = "#000000"
                            android:text="@string/yes" />

                        <RadioButton 
                            android:id="@+id/contact_no"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:color = "#000000"
                            android:text="@string/no" />
                </RadioGroup>

It's always white, and I would like to change to black?

Thank you in advance

Ravi
  • 34,851
  • 21
  • 122
  • 183
user1256477
  • 10,763
  • 7
  • 38
  • 62

4 Answers4

1

The attribute is textColor="#ffff00ff" for example

Kirk
  • 4,957
  • 2
  • 32
  • 59
Sanandrea
  • 2,112
  • 1
  • 27
  • 45
1
android:textColor="#000000"

or

android:textColor="@android:color/black"

use textColor to change color of text

<RadioButton android:id="@+id/contact_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:color = "#000000"
android:text="@string/yes" />
Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
1

Try this:

<RadioButton 
android:id="@+id/contact_yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/yes" />
Zelleriation
  • 2,834
  • 1
  • 23
  • 23
0

You can use android:textColor method to do that.

An example is android:textColor="#00000000"

In #00000000 the two left bit is transparent bit . #00 (transparent) 00 (Red Color) 00 (Green color) 00 (Blue color). they are hex.

To more details about transparent bit see Set transparent background.

Community
  • 1
  • 1
shayan
  • 220
  • 2
  • 8