Issue
I need to create a drawable for the following image.
I tried the following drawable
<item>
<shape android:shape="rectangle">
<stroke android:width="3dp"
android:color="#FF999999"/>
<solid android:color="#00000000"/>
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
</shape>
</item>
<item >
<shape android:shape="oval">
<solid android:color="@color/white"/>
<size android:width="3dp"
android:height="3dp"/>
</shape>
</item>
</layer-list>
But All I am getting is just the circle, I couldn't figure out how to bring up the rectangular border. where am I going wrong???
Solution
The item needs width and height as well. You also need to say the circle to be with the center gravity. Feel free to change the width/Colors too.
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:height="5dp" android:width="5dp" >
<shape android:shape="rectangle">
<stroke android:width="3dp"
android:color="#FF999999"/>
<solid android:color="#00000000"/>
</shape>
</item>
<item android:height="3dp" android:width="3dp" android:gravity="center">
<shape android:shape="oval">
<solid android:color="@android:color/white"/>
<size android:width="3dp"
android:height="3dp"/>
</shape>
</item>
</layer-list>
Answered By - Dhinakaran Thennarasu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.