1

I am using the layer-list to draw the circle likeenter image description here

I checked in Android N its working fine but in KitKat, only inner circle with the pink order is showing.

This is my layer-list drawable:

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- larger circle at the back -->
    <item
        android:width="60dp"
        android:height="60dp"
        android:gravity="center">
        <shape android:shape="oval">
            <solid android:color="@color/white" />
        </shape>
    </item>


    <!-- inner circle -->
    <item
        android:width="40dp"
        android:height="40dp"
        android:gravity="center">
        <shape android:shape="oval">
            <solid android:color="@color/white" />
            <stroke
                android:width="1dp"
                android:color="@color/vivid_cerise" />
        </shape>
    </item>
</layer-list>
azizbekian
  • 60,783
  • 13
  • 169
  • 249
Rahul Devanavar
  • 3,917
  • 4
  • 32
  • 61
  • This happens with drawables. What you can do is use bitmap and canvas to create your circle programmatically and then set it your image or image background. – mudit_sen Jul 11 '17 at 05:54

1 Answers1

2

You have to pay attention to lint warnings:

enter image description here

android:width and android:height attributes are accessible from API 23 onwards, whereas KitKat is API 19.

azizbekian
  • 60,783
  • 13
  • 169
  • 249