如何在单个渐变中合并两个形状 android

How to merge two shapes in a single gradient android

如何合并 both.how 中的边框或单一渐变到可能?

已经尝试过如下这种背景形状:- shape.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:top="175dp">
    <shape android:shape="oval">
        <gradient
            android:angle="135"
            android:startColor="#f56f2c"
            android:endColor="#fa9f46"/>

    </shape>

</item>
<item
    android:bottom="40dp"
    >
    <shape android:shape="rectangle">
        <gradient
            android:angle="135"
            android:startColor="#f56f2c"
            android:endColor="#fa9f46"/>
    </shape>
 </item>
</layer-list>

我解决了这个问题...将渐变角度更改为 90.the 问题是保持颜色变化在一起 borders.fixed 项目每个寄宿生的颜色相同。

示例:

<item
    android:top="165dp">
    <shape android:shape="oval"
      >
        <gradient
            android:angle="0"
            android:startColor="#C96DD8"
            android:centerColor="#C96DD8"
            android:endColor="#C96DD8"/>

    </shape>
</item>
<item
    android:bottom="40dp">
    <shape android:shape="rectangle">
        <gradient
            android:angle="-90"
            android:startColor="#3023AE"
            android:centerColor="#7344ac"
            android:endColor="#C96DD8"/>
    </shape>
</item>

示例:

<item
    android:top="165dp">
    <shape android:shape="oval"
      >
        <gradient
            android:angle="0"
            android:startColor="#C96DD8"
            android:centerColor="#C96DD8"
            android:endColor="#C96DD8"/>

    </shape>
</item>
<item
    android:bottom="40dp">
    <shape android:shape="rectangle">
        <gradient
            android:angle="-90"
            android:startColor="#3023AE"
            android:centerColor="#7344ac"
            android:endColor="#C96DD8"/>
    </shape>
</item>