1

My Current view looks like this:

My current view with 'MyHouses'

I tried to draw a shape drawable with this code:

    <?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <!-- Outer green rectangle-->
    <item
        android:bottom="140dp">
        <shape android:shape="rectangle">
            <size
                android:width="100dp"
                android:height="200dp" />
            <solid android:color="#ff5500" />
        </shape>
    </item>

    <item
        android:top="180dp"
        android:bottom="140dp">
        <shape android:shape="rectangle">
            <size
                android:width="20dp"/>
            <solid android:color="#ffffff" />
        </shape>
    </item>


    <!-- inner white rectangle -->
    <item
        android:bottom="-10dp"
        android:right="90dp"
        android:left="90dp">
        <rotate
            android:fromDegrees="-85">
            <shape android:shape="rectangle">
                <size
                    android:width="30dp"/>
                <solid android:color="#ffffff" />
            </shape>
        </rotate>
    </item>
</layer-list>

and I managed to get this shape:

Shape using ShapeDrawable]2

The problem is that when I give this shape as a background of my layout, it looks like this:

enter image description here

Where as my final goal is to make it look like this:

enter image description here

Community
  • 1
  • 1
Damandroid
  • 756
  • 9
  • 31

1 Answers1

0

change your drawable file like this

 <?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Outer green rectangle-->

    <item>
        <shape android:shape="rectangle">
            <solid android:color="#ff5500" />
        </shape>
    </item>

    <item android:bottom="-720dp">
        <rotate android:fromDegrees="-85">
            <shape android:shape="rectangle">
                <solid android:color="#ffffff" />
            </shape>
        </rotate>
    </item>


    <!-- inner white rectangle -->

</layer-list>