1

I want to Create a Gradient like this but :

left gradiant is my goal gradiant right gradiant is my gradiant this is my gradiant code xml :

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
    android:centerColor="#ffffff"
    android:endColor="#4f4f4f"
    android:gradientRadius="700"
    android:startColor="#ffffff"
    android:type="radial" >
</gradient>

please help to create a gradient like left picture thx

Edited : in real Device My gradiant show white . Edit2 : These Gradiant My Friend Post Ok but color in goal gradiant Not show in real device no Alternative Ways ?

zobydeh karimi
  • 57
  • 1
  • 2
  • 7

2 Answers2

0

Do this :

   <?xml version="1.0" encoding="utf-8"?>
   <shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle" >
       <gradient
            android:centerColor="#E7E6E6"
            android:endColor="#DADADA"
            android:gradientRadius="800"
            android:startColor="#EEEDED"
            android:type="radial" >
       </gradient>
   </shape>

Screenshot :

enter image description here

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
0

Here is a tool using this you can design any drawable Tool

try this

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <gradient
        android:type="linear"
        android:startColor="#FF2d7706"
        android:endColor="#FF98d434"
        android:angle="90"/>
</shape>

enter image description here

Mehul Kabaria
  • 6,404
  • 4
  • 25
  • 50