4

I dont know whether I am asking is wrong or not. But can I have an image in this shape xml so that if provide an image then it's corners become rounded.

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android">  
    <corners android:radius="5dp" /> 
    <solid android:color="#F87217"/> 
    <stroke
        android:width="1dip"
        android:color="#f0f0f0" />
</shape> 
James
  • 13,891
  • 26
  • 68
  • 93
  • you can try a layer list. This could be a similar case: [Shape drawable with an image](http://stackoverflow.com/questions/6263867/how-to-use-a-shape-drawable-together-with-an-image) – SamSPICA Dec 06 '11 at 05:37
  • Can it make a non-rounded cornered image cornered by the radius we specify. – James Dec 06 '11 at 09:04
  • But how can I provide an image in this xml – James Dec 07 '11 at 02:37

1 Answers1

1

You may try this

<item
    android:drawable="@drawable/ic_broadcast"
    android:left="3px"
    android:right="3px"
    android:top="3px">
    <shape android:shape="rectangle" >
        <solid android:color="#cc2b2b" />


        <corners android:radius="8dp" />
    </shape>

</item>

ic_broadcast is an image from your res folder

Rekin
  • 9,731
  • 2
  • 24
  • 38