Vaibhav Goel wrote:
> Hi
> 
> I want to make a custom seek bar having color gradient as shown in the
> below image url.
> 
> http://i49.tinypic.com/2mi5lsh.jpg
> 
> For this I tried to make background as
> 
> seek_background.xml
> 
> <shape xmlns:android="http://schemas.android.com/apk/res/android";
> android:shape="rectangle">
>     <gradient android:startColor="#FFFFAA00"
> android:endColor="#FFFF0000"
>             android:angle="0"/>
>     <stroke android:width="1dp" android:color="#AAFFFFFF" />
>     <padding android:left="7dp" android:top="7dp"
>             android:right="7dp" android:bottom="7dp" />
>     <corners android:radius="4dp" />
> </shape>
> 
> 
> and Seekbar in layout xml as
> 
>     <SeekBar
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content"
>     android:padding="20sp"
>     android:progressDrawable="@drawable/seek_background"/>
> 
> But it makes the complete background colored as shown in below url.
> 
> http://i47.tinypic.com/104ktxe.jpg

Since SeekBar extends ProgressBar, you may wish to start with
progress_horizontal.xml as your base point. You'll notice that it
defines a few layers in a <layer-list> drawable resource,
differentiating the true background from the "progress". I'm not 100%
certain this is the background used by SeekBar by default, but it's an
educated guess.

You can find this file in
$ANDROID_HOME/platforms/$API/data/res/drawable, where $ANDROID_HOME is
where you have the SDK installed and $API is one of the API versions you
have installed (e.g., android-2.1).

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

Android Development Wiki: http://wiki.andmob.org

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

Reply via email to