Hi,

now I have found a pretty easy way to get a gradient background myself! :-)

*Here is how it works*

Create a XML file in drawable folder, its content should look like this:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android";
    android:shape="rectangle"
    android:useLevel="false" >
    <gradient
        android:startColor="#000000"
        android:endColor="#ffffff"
        android:useLevel="false"
        android:type="linear"
        android:angle="90" />
</shape>

Second step, adjust your styles.xml file in values folder and add following 
line to your ActionBar style:

<item 
name="android:background">@drawable/NAME_OF_CREATED_XML_FILE_WITHOUT_DOT_XML</item>

Now you should have an ActionBar which is black at the top and white at the 
bottom and transitions the color between bottom and top.

Have fun!

Am Mittwoch, 18. Juli 2012 11:52:15 UTC+2 schrieb mx_joe:
>
> Hi,
>
> I started developing an App for Android 2 months ago but there is one 
> thing still annoying me:
>
> I still haven't found a way to use a gradient background in my ActionBar! 
> Is there any way to achieve this without using a background image?
>
> I am looking forward to your help.
>
> Greetz
> Joe
>

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