1.selector
用法: android:background="@drawable/...."
为一个按钮做翻转效果
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@........................." />
<item android:state_focused="true" android:drawable="@.........................." />
<item android:drawable="@color/bg_titlebar_textview_normal" />
</selector>
2.shape
<shape>
<!-- 实心 --> <solid android:color="#ff9d77"/>
<!-- 渐变 --> <gradient android:startColor="#ff8c00" android:endColor="#FFFFFF" android:angle="270" />
<!-- 描边 --> <stroke android:width="2dp" android:color="#dcdcdc" />
<!-- 圆角 --> <corners android:radius="2dp" />
<!-- 内边距 --> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" />
</shape>
渐变效果(0,90,180从左到右渐变,270从上到下渐变)
参考: http://blog.csdn.net/jdsjlzx/article/details/7777399
3.