Android 边框圆角
RelativeLayout 圆角实现:
drawable目录下面定义shape的xml文件:
mall_header_rel_bg.xml
-
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="@color/white" /> <corners android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> </shape>
- 代码里面通过如下代码引用
-
android:background="@drawable/mall_header_rel_bg"
solid定义颜色,corners定义边角弧度,值越大,弧度越大,值越小,弧度越小