I need to apply corner radius to a LinearLayout
which also has a background for shadow effect. When I try to add corner radius to the background XML I only get white background on the corners. I will demonstrate what I mean with code and photos.
This is the code in the shadow.xml
(notice the line with <corners android:radius="30dp"/>
):
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--the shadow comes from here-->
<item
android:bottom="0dp"
android:drawable="@android:drawable/dialog_holo_light_frame"
android:left="0dp"
android:right="0dp"
android:top="0dp">
</item>
<item
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp">
<!--whatever you want in the background, here i preferred solid white -->
<shape android:shape="rectangle">
<solid android:color="@color/myPink" />
<corners android:radius="30dp"/> //THIS LINE IS NOT INCLUDED IN PHOTO 1
</shape>
</item>
This is the starting point (without <corners android:radius="30dp"/>
in shadow.xml
):
And this is the result I am getting (with <corners android:radius="30dp"/>
in shadow.xml
)
Now how can the corner radius without the white background on the corners of the Linear Layout?