Android 边框圆角

RelativeLayout 圆角实现:
 drawable目录下面定义shape的xml文件:
mall_header_rel_bg.xml
  1. <?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>
  2. 代码里面通过如下代码引用
  1. android:background="@drawable/mall_header_rel_bg"
solid定义颜色,corners定义边角弧度,值越大,弧度越大,值越小,弧度越小
 
posted @ 2015-10-09 11:22  西北野狼  阅读(272)  评论(1编辑  收藏  举报