Specifying SeekBar colors in layout file ...

by Mark Rosenberg » Tue, 01 Dec 2009 10:29:40 GMT


Sponsored Links
 Seems to me that I should be able to set the colors of the SeekBar
thumb, slider, and progress bar in my layout xml file. However, I
don't see relevant attributes for these SeekBar components. I only
want to change the colors, not replace any images being used for the
thumb, etc. What am I missing?

--



Specifying SeekBar colors in layout file ...

by Romain Guy » Tue, 01 Dec 2009 10:33:14 GMT


 Hi,

You can see how we do it in the standard version of Android:
 http://android.git.kernel.org/?p=platform/frameworks/base.git ;a=blob;f=core/res/res/drawable/progress_horizontal.xml;h=57d85898a4dd3cb57f24f6e39fecb57556d14be0;hb=master

Note however that changing the colors of the thumb will require to
provide new images. You won't be able to do that just from XML.

On Mon, Nov 30, 2009 at 6:29 PM, Mark Rosenberg


>


Sponsored Links


Specifying SeekBar colors in layout file ...

by NoraBora » Tue, 01 Dec 2009 12:32:56 GMT


 I wanted to change not only color but the images of bar & thumb.

and I found something strange...

please see this link.



Specifying SeekBar colors in layout file ...

by Mark Rosenberg » Wed, 02 Dec 2009 05:58:08 GMT


 Thanks for the example. Still not clear on how to proceed. Can I
override the stuff in Android's built-in progress_horizontal.xml? Do I
create an replacement layer-list? If so, how do I tie it into my
SeekBar XML declaration? Or should I be looking at building my own
ProgressBar subclass?




> >



Specifying SeekBar colors in layout file ...

by NoraBora » Wed, 02 Dec 2009 10:10:52 GMT


 You don't have to make any subclasses.

make your_progress_horizontal.xml under drawable directory and

use it in your_layout.xml like this.

<SeekBar android:id="@+id/SeekBar01"
       android:layout_width="fill_parent"
android:layout_height="wrap_content"
       android:progressDrawable="@drawable/your_progress_horizontal"
       />

On Dec 2, 6:57am, Mark Rosenberg <markrosenberg01460...@gmail.com>




> > >



Specifying SeekBar colors in layout file ...

by Mark Rosenberg » Fri, 04 Dec 2009 02:04:59 GMT


 Romain and Nora,

Thanks to you both.






> > > >