SoFunction
Updated on 2025-04-11

Android Quickly draw an instance of a rounded rectangle

During Android development, it is often necessary to draw some simple color graphics. Here is a simplest graphic.

Rounded rectangle:

res\drawable\shape_small_label.xml

<?xml version="1.0" encoding="utf-8"?>
<shape
 xmlns:andro>
 <!-- Internal color -->
 <solid
  android:color="#ffffff" />
 <!-- Edge line color -->
 <stroke
  android:width="1dp"
  android:color="@color/rgb53_99" />
 <!-- The amplitude of the rounded corners -->
 <corners
  android:topLeftRadius="5dip"
  android:topRightRadius="5dip"
  android:bottomLeftRadius="5dip"
  android:bottomRightRadius="5dip" />
</shape>

The above example of Android quickly drawing a rounded rectangle is all the content I share with you. I hope you can give you a reference and I hope you can support me more.