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

圆角矩形

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>
发布了14 篇原创文章 · 获赞 1 · 访问量 8049

猜你喜欢

转载自blog.csdn.net/hua199237/article/details/52756800