0

I am trying to create a following shape in android.

enter image description hereI tried following code but it's only for changing the corners

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid android:color="#ffffff" />

<gradient
    android:startColor="#00EBCF"
    android:endColor="#00BEEC"
    android:angle="180"
    android:type="linear" />

<corners
    android:bottomLeftRadius="80dp"
    android:bottomRightRadius="80dp"
    android:topLeftRadius="0dp"
    android:topRightRadius="0dp" />

What do I need to make changes in code to achieve the above shape?

Edit1

As per the answer I used following code (modifications in layout height):

<?xml version="1.0" encoding="utf-8"?>
    </shape>
</item>

<item
    android:width="1500dp"
    android:height="200dp"
    android:top="95dp">
    <shape android:shape="oval">
        <solid android:color="#36D6E9" />

    </shape>
</item>

But when I am using this layout as a background for LinearLayout. It's showing me this:

 <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:background="@drawable/header_shape_rect">

enter image description here

Community
  • 1
  • 1
Amit Pal
  • 10,604
  • 26
  • 80
  • 160

1 Answers1

0

enter image description hereuse this as an example

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

    <item android:height="200dp">
        <shape android:shape="rectangle">
            <solid android:color="#ccc"/>
        </shape>
    </item>

    <item android:height="200dp" android:top="95dp" android:width="1500dp" >
        <shape android:shape="oval">
            <solid android:color="#ccc"/>
        </shape>
    </item>

</layer-list>
Drilon Blakqori
  • 2,796
  • 2
  • 17
  • 25
Sony
  • 7,136
  • 5
  • 45
  • 68