I want shape in the background of the layout like given below picture. I have tried something , Which is given below.
borders.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--Layer 0-->
<!--Layer 1-->
<!--Layer 2-->
<!--Layer 3-->
<!--Layer 4 (content background)-->
<!-- dropshadow -->
<item>
<shape>
<solid android:color="#10CCCCCC" />
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#20CCCCCC" />
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#40CCCCCC" />
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#50CCCCCC" />
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#60CCCCCC" />
<padding android:top="1dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
</shape>
</item>
<!-- content background -->
<item>
<shape>
<solid android:color="#ffffff" />
</shape>
</item>
</layer-list>
And layout set as
android:background="@drawable/borders"
Through this implementation, I am getting like this
How can I get the drop shadow with rounded corners like below image?
xml file and add an attribute to that TextView, for which you want to add rounded corners. The attribute is android: background=”@drawable/rounded_corner_view”.
you should add "corners" to the shape:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffffff"/>
<stroke android:width="3dp"
android:color="#ff000000"
/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
<corners android:radius="7dp"/>
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