androidandroid-text-color

radiobutton change text color


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


Solution

  • 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" />