开发者

Overwrite android seekbar style

开发者 https://www.devze.com 2023-02-06 21:55 出处:网络
I would like to overwrite the default android Widget.SeekBar style that looks like this: <style name=\"Widget.SeekBar\"开发者_运维技巧>

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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消