按钮 背景 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/control3_1" android:state_enabled="true" android:state_focused="true" android:state_pressed="false"/> <item android:drawable="@drawable/control3_1" android:state_enabled="true" android:state_pressed="true"/> <item android:drawable="@drawable/control3_1" android:state_checked="true" android:state_enabled="true"/> <item android:drawable="@drawable/control3_0"/> </selector>
check_box 背景
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/check_true1" android:state_checked="true"></item>
<item android:drawable="@drawable/check_true1" android:state_selected="true"></item>
<item android:drawable="@drawable/check_false1"></item>
</selector>
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_pressed="true" android:drawable="@mipmap/link_check" /> <item android:state_checked="false" android:state_pressed="true" android:drawable="@mipmap/link_uncheck" /> <item android:state_checked="false" android:drawable="@mipmap/link_uncheck" /> <item android:state_checked="true" android:drawable="@mipmap/link_check" /> </selector>
单背景色 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#3B87F6"/> <corners android:radius="6dp" /> </shape>
圆 背景色
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" android:useLevel="false"> <solid android:color="@color/background9"/> <stroke android:width="1dp" android:color="@color/background9" /> <size android:width="48dp" android:height="48dp" /> </shape>
背景渐变色
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="12dp" /> <gradient android:angle="0" android:startColor="#3F9BF0" android:endColor="#1C71E6" /> </shape>
图片旋转
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:drawable="@drawable/loading_icon" android:fromDegrees="0.0" android:pivotX="50.0%" android:pivotY="50.0%" android:toDegrees="360.0"/> </item> </layer-list>
单线条边框背景 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="10dp"/> <stroke android:width="1dp" android:color="@color/textcolor59" /> </shape>