Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overwrite android seekbar style

I would like to overwrite the default android Widget.SeekBar style that looks like this:

<style name="Widget.SeekBar">
        <item name="android:indeterminateOnly">false</item>
        <item name="android:progressDrawable">@android:drawable/progress_horizontal</item>
        <item name="android:indeterminateDrawable">@android:drawable/progress_horizontal</item>
        <item name="android:minHeight">20dip</item>
        <item name="android:maxHeight">20dip</item>
        <item name="android:thumb">@android:drawable/seek_thumb</item>
        <item name="android:thumbOffset">8dip</item>
        <item name="android:focusable">true</item>
</style>

How can I do that? I have tried declaring the style again in the manifest.xml but that does not work.

like image 672
Atticus Avatar asked Feb 22 '26 11:02

Atticus


2 Answers

You have to implement style in xml file which you wan to implement. Then in layout xml file where you use the SeekBar, you have to just set the style in android:style="" attribute.

In style.xml:

<SeekBar style="@style/seekbar_style" />
like image 141
chikka.anddev Avatar answered Feb 24 '26 14:02

chikka.anddev


I think you need to write your stuff into a own xml and put it into layout.

This might help you:

custom seekbar

Android: Custom Drawable in a SeekBar widget is drawing aliased images

like image 28
Beasly Avatar answered Feb 24 '26 14:02

Beasly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!