- //round_corner_bg.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle" >
- <!-- 填充的颜色 -->
- <solid android:color="#ff000000" />
- <!-- 设置矩形的四个角为弧形 -->
- <!-- android:radius 弧形的半径 -->
- <corners android:radius="7dip" />
- </shape>
layout中给button加上background属性
android:background="@drawable/round_corner_bg"
上述方法也适用于其他控件
http://blog.csdn.net/singwhatiwanna/article/details/9198917