ceryle / RadioRealButton

A custom radio button for Android API 12+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ho to change text color of selected button?

imTefa opened this issue · comments

Hi I am trying to change the selected button color but with no success

color_selector.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/color_white" android:state_selected="true" /> <item android:color="@android:color/black" /> </selector>

and this is my radio button

<co.ceryle.radiorealbutton.RadioRealButton android:layout_width="0dp" android:layout_height="wrap_content" android:weightSum="1" app:rrb_textColor="@color/color_selector" app:rrb_text="FAN" />

Use the rrb_textColorTo attribute

<co.ceryle.radiorealbutton.RadioRealButton
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 app:rrb_text="Button"
 app:rrb_textColor="@android:color/black"
 app:rrb_textColorTo="@android:color/white" />

It works, Thanks