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

本文详细阐述了如何使用XML语法定义矩形形状,包括填充颜色、边框宽度、颜色和样式,以及圆角半径等关键属性。

1234

被折叠的 条评论
为什么被折叠?



