Ajay Patel
Ajay Patel

Reputation: 5418

Gradient options in Android?

I am posting radial code for Gradient layout.. what can i use for linear layout ? Or in simple i need liner gradient layout in my android app background.. without using image ?

<?xml version="1.0" encoding="UTF-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
        <gradient 
            android:startColor="#93cc1a" 
            android:endColor="#6C9B06"
            android:type="radial"
            android:gradientRadius="326"
        />                
    </shape>

Upvotes: 1

Views: 2472

Answers (2)

hector6872
hector6872

Reputation: 1336

ya . its the code which i need... can you please explain about android:angle

  • 0 = left to right (startColor > endColor)
  • 90 = bottom to top (startColor > endColor)
  • 180 = right to left (startColor > endColor)
  • 270 = top to bottom (startColor > endColor)

Upvotes: 0

Anton Derevyanko
Anton Derevyanko

Reputation: 3445

<gradient android:type="linear" 
 android:startColor="#ffffff" 
 android:endColor="#005aa9" 
 android:angle="270.0" /> 

Are you asking about linear gradient?

Upvotes: 2

Related Questions