Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradient like this?

I'm not UI designer so I can't feel xml colors enough, I want to make gradient like this:

http://t1.uccdn.com/en/images/6/5/2/img_2256_ins_45517_600.jpg

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape>
        <gradient
            android:startColor="#1f313d"

            android:endColor="#2c3942"
            android:angle="135"/>
    </shape>
</item>

but... I think that 2 colors are not enough, how to make it similar gradieñt to this image then? *last screen

like image 730
ramzixp Avatar asked Dec 25 '22 03:12

ramzixp


2 Answers

How to create Gradient ??

Create Gradient is very easy

  1. Right click on drawable folder and create xml file.

  2. Create shape Tag

  3. Inside shape tag create gradient tag

Gradient Properties........

android:startColor="put here your color"
android:endColor="put here your color"
android:centerColor="put your color here"
android:angle="45"

if you need gradient in

horizontal way put angle = "0"

vertical way put angle = "90"

corner horizontal way put angle = "45"

and opposite of corner horizontal way put angle = "135"

use this .......

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

    <gradient android:startColor="#915d5b"
        android:endColor="#418c47"
        android:angle="45"></gradient>
</shape>

output

enjoy coding.......

like image 117
sushildlh Avatar answered Dec 31 '22 17:12

sushildlh


Or you could simply use Gradient Generator tools at AngryTools, which is much easier and fun to use.

like image 34
Curator Avatar answered Dec 31 '22 17:12

Curator