ramzixp
ramzixp

Reputation: 17950

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

Upvotes: 4

Views: 531

Answers (2)

sushildlh
sushildlh

Reputation: 9056

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

Upvotes: 8

Curator
Curator

Reputation: 46

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

Upvotes: 2

Related Questions