0

我想在android中创建以下形状。如何在Android中创建以下形状?

enter image description here我尝试下面的代码,但它只是改变了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" /> 

什么,我需要做的代码更改为实现上述形状?

EDIT1

按答案我用下面的代码(在布局高度修改):

<?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> 

但是,当我使用这个布局作为backgroundLinearLayout。它显示我:

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

enter image description here

回答

0

enter image description here使用这个作为一个例子

<?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> 
+0

它说:'元项目必须declared' –

+0

但它没有显示图层列表在这里我不知道为什么。将这两个'物品'包裹在''中。我已添加代码 – Sony

+0

的屏幕截图感谢您的回答。请查看#Edit1部分我的问题详情。 –