rounded rectangle shape in android

Please follow and like us:

Rounded Rectangle Shape for Drawable

This tutorial is about to explain, how to use <Shape> </Shape> for making rounded rectangle shape drawable background for any android views.

Let’s see example of Rounded Rectangle Shape in android

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <!-- Add Color for background-->
    <solid android:color="#ffffff" />
    <!-- Add Color and width for border-->
    <stroke

        android:width="1dp"
        android:color="#ccc" />
    <!-- add radious for rounded shape-->
    <corners
        android:bottomLeftRadius="2dp"
        android:bottomRightRadius="2dp"
        android:topLeftRadius="2dp"
        android:topRightRadius="2dp" />
</shape>

Hope you liked our “rounded rectangle shape in android” tutorials, thanks. Keep visiting our blog for latest Android development tutorials.

nirav kalola