android 开发过程中,经常需要绘制一些简单的颜色图形。下面贴上一段最简单的图形。
圆角矩形:
res\drawable\shape_small_label.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!-- 内部颜色 --> <solid android:color="#ffffff" /> <!-- 边缘线条颜色 --> <stroke android:width="1dp" android:color="@color/rgb53_99" /> <!-- 圆角的幅度 --> <corners android:topLeftRadius="5dip" android:topRightRadius="5dip" android:bottomLeftRadius="5dip" android:bottomRightRadius="5dip" /> </shape>
以上这篇Android 快速绘制一个圆角矩形的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。