Skip to content Skip to sidebar Skip to footer

Shape Drawable Not Working?

Solution 1:

use this code,

<?xml version="1.0" encoding="utf-8"?><layer-listxmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:top="4dp"android:right="4dp"android:bottom="4dp"android:left="4dp"><shapeandroid:shape="oval"><solidandroid:color="#ff0000" /></shape></item><item><shapeandroid:shape="oval"><strokeandroid:width="2dp"android:color="#ff0000"/></shape></item></layer-list>

using ring shape

<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="ring"android:innerRadius="15dp"android:thickness="10dp"android:useLevel="false"><solidandroid:color="#ff0000" /></shape>

Solution 2:

You can try like this for ring shape with fill transparent. set this drawable to your control.

<shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><cornersandroid:radius="10dip" /><strokeandroid:width="2dip"android:color="@color/white" /><sizeandroid:width="100dp"android:height="100dp" /><solidandroid:color="@android:color/transparent" /></shape>

Post a Comment for "Shape Drawable Not Working?"