steele johnson wrote:
> I can't seem to find any docs that explain how to define a color
> gradient on a view in xml. Can someone point me to an example? Thanks.

Put something like this in res/drawable/yournamehere.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android";
android:shape="rectangle">
        <gradient
                android:startColor="#66FFFFFF"
                android:endColor="#FFFFFFFF"
                android:angle="270"/>
</shape>

Then, it's just a drawable, so you can use it like any other drawable
(e.g., @drawable/yournamehere as, say, android:background).

There are other gradient XML files in ApiDemos (look in res/drawable).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to