您的位置:首页 > 移动开发 > Android开发

Android 边框圆角

2015-10-09 11:22 471 查看


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定义边角弧度,值越大,弧度越大,值越小,弧度越小
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: