博客地址:zeyang’s blog
drawable文件夹里加入 round.xml 内容如下
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#FFFFFF" >
</solid>
<padding
android:bottom="10dp"
android:left="10dp"
android:right="10dp"
android:top="10dp" >
</padding>
<corners android:radius="15dp" >
</corners>
</shape>
然后再在button或其他元素里调用就好了
例如:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="完成"
android:background="@drawable/round" />