5

I have a drawable xml file which draws a circle.

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<solid

    android:color="#666666" />

<size
    android:width="120dp"
    android:height="120dp" />
</shape>

now, I have to add a image in drawable folder. please help me where to change the code.

kashyap
  • 81
  • 1
  • 2
  • 7

1 Answers1

21

You can use a layer list like this

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
   <item>
       <shape android:shape="oval">
           <solid
               android:color="#666666"/>

           <size
               android:width="120dp"
               android:height="120dp"/>
       </shape>
   </item>

   <item android:drawable="@drawable/your_drawable"/>
</layer-list>
François Legrand
  • 1,151
  • 1
  • 14
  • 25