USAGE:
xml file saved at res/color/button_text.xml
:
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_PRessed="true" android:color="#ff1bb5d7"/> <!-- pressed --> <item android:state_focused="true" android:color="#ff0000ff"/> <!-- focused --> <item android:color="#ff000000"/> <!-- default --></selector>This layout XML will apply the color list to a View:<Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/button_text" android:textColor="@color/button_text" />
新闻热点
疑难解答