I know how to make rectangle with rounded corners, like this
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="#FF0000"/>
<corners
android:radius="10000dp" />
</shape>
It looks like this:
But I want to make the inverse of that (center transparent and sides filled with color), which should look like this:
Thanks
Not proper way, but will get the result, try
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<padding
android:bottom="-100dp"
android:left="-100dp"
android:right="-100dp"
android:top="-100dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="200dp" />
<stroke
android:width="100dp"
android:color="#FF0000" />
</shape>
</item>
</layer-list>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With