Reputation: 3
I'm trying to change a rectangle shape from its vertical to horizontal in an Android app with the XML, but it is not working. It simply draws a horizontal shape without its oval shape.
main.xml:
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#5ebb1e" />
</shape>
</item>
<item
android:bottom="400dp"
android:left="-100dp"
android:right="-100dp"
android:top="-200dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:angle="90"
android:endColor="#65FFFFFF"
android:startColor="#65FFFFFF" />
</shape>
</item>
<item
android:bottom="402dp"
android:left="-100dp"
android:right="-100dp"
android:top="-280dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#2a2a2a" />
</shape>
</item>
Upvotes: 0
Views: 61
Reputation: 1538
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<solid android:color="#5ebb1e" />
</shape>
</item>
<item
android:right="200dp"
android:left="-160dp"
android:top="0dp"
>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
>
<gradient
android:angle="90"
android:endColor="#65FFFFFF"
android:startColor="#65FFFFFF" />
</shape>
</item>
<item
android:right="200dp"
android:left="-200dp"
android:top="0dp">
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#2a2a2a" />
</shape>
</item>
</layer-list>
just change your left -right top -bottom
Upvotes: 1