Android Create Drawable XML with Image rounded top corners



I'm trying to create an Android XML Drawable that I can use as the background for one of my LinearLayouts. I need the background to have an image, with the top left and top right corners rounded with a 10dp radius. I've been trying with the code below, but just can not seem to get it working. Is this possible? Any help is greatly appreciated!!



<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://ift.tt/nIICcg">
<item>
<shape android:shape="rectangle">
<corners android:topLeftRadius="10dp"
android:topRightRadius="10dp">
</corners>
</shape>
</item>
<item>
<bitmap android:src="@drawable/bg_navbar_blur" />
</item>

No comments:

Post a Comment