Quantcast
Channel: How to create drawable circle with below requirement? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How to create drawable circle with below requirement?

$
0
0

enter image description hereI'm trying create a circular shaped drawable to put as overlay for profile pictures(circular images)I wrote the below code for circular drawable overlay,

<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"><item><shape><solid android:color="@color/light_blue_bg" /></shape></item><item><shape android:shape="oval"><stroke                android:width="2dp"                android:color="@android:color/white" /><solid android:color="@android:color/transparent" /></shape></item></layer-list>

Refer the output in the below screen image,enter image description here

Known Issues: I'm creating a rectangle with @color/light_blue_color and it has inner oval shape with stroke color and inner solid transparent color, but due to outer rectangle color inner circle transparency not showing picture.If I remove outer rectangle color real square picture will come out of circular overlay.

Is there any way to give color to outer circular portion alone?

Any help ll be highly appreciated


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>