此文章原创地址:http://blog.csdn.net/ltf857/article/details/52288813
创建drawable文件:
?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp" />
<solid android:color="#ffffff" />
<size
android:width="100dp"
android:height="20dp" />
<stroke
android:width="1dp"
android:color="#000000" />
</shape>
solid:更改内部颜色
stroke:更改边框宽度,更改边框颜色
使用
android:background调用
<Button
android:id="@+id/yuan"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/btn_style"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="变圆" /