views:

45

answers:

2

I have the following drawable:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    <gradient 
        android:startColor="#2F2F2F" 
        android:endColor="#5A5A5A"
        android:angle="90"
        android:dither="true"
     />
</shape>

Is there anyway to start the startColor at 50% or the endColor at 50%?

Are there any links that show me all of the attributes I can apply to a gradient?

A: 

These pages show all the attributes you can apply to a gradient.

http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

http://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html

To do something in the middle like you are asking, try experimenting with the android:centerColor attribute.

mbaird
A: 

Are you talking about transparency? I'm fairly certain you can just use a 8-digit color code rather than a 6-digit, the first 2 of which constitute the alpha value. So #AARRGGBB, or something like #882F2F2F.

kcoppock