本周我学习了android的ui shape和selector的用法
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:drawable="@drawable/btn_next_bg_nor" ></item> <item android:state_pressed="true" android:drawable="@drawable/btn_next_bg_press" ></item> </selector>
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 填充底色 --> <solid android:color="@color/colorButtonNormal" ></solid> <!-- 设置一个圆角 --> <corners android:radius="5dp" ></corners> <!-- 描边 --> <stroke android:width="1dp" android:color="@color/colorButton" ></stroke> </shape>