1、推荐http://angrytools.com/android/button/,可实现很多xml背景效果
2、总结如下
第一个drawable,是虚线边框:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="32px"></corners>
<stroke
android:width="3px"
android:color="#7ecef4"
android:dashGap="6px"
android:dashWidth="10px"></stroke>
<solid android:color="#fff" />
<padding
android:bottom="10dp"
android:left="0dp"
android:right="0dp"
android:top="10dp"></padding>
</shape>
第二个drawable,是实线边框:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="32px"></corners>
<stroke
android:width="3px"
android:color="#7ecef4"
></stroke>
<solid android:color="#fff" />
<padding
android:bottom="10dp"
android:left="0dp"
android:right="0dp"
android:top="10dp"></padding>
</shape>
第三个drawable,椭圆渐变
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
>
<gradient
android:startColor="#000"
android:endColor="#7ecef4"
android:centerX="2"
android:gradientRadius="44"
android:angle="270"/>
<padding
android:bottom="10dp"
android:top="10dp"/>
</shape>
第四个如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<gradient
android:startColor="#000"
android:endColor="#7ecef4"
android:angle="45"/>
<padding
android:bottom="10dp"
android:top="10dp"/>
</shape>