您的位置:首页 > 其它

xml 中画圆角矩形、虚线、实线

2016-10-08 15:11 204 查看

圆角矩形

res中的drawable文件新建一个reac_circle.xml文件

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF"></solid>
<stroke android:width="1dp"
android:color="#63a219</stroke>

<corners android:radius="10dp" />

</shape>


虚线

<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 填充颜色 -->
<solid android:color="#FFFFFF"/>
<!-- 线的宽度,颜色灰色 -->
<stroke android:color="#063671" android:dashWidth="15dp" android:dashGap="3dp" android:width="2dp"/>
<!-- 矩形的圆角半径 -->
<!--<corners android:radius="10dp" />-->

</shape>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: