Seek bar, change path color from yellow to white

后端 未结 7 590
野性不改
野性不改 2020-11-27 12:29

I have two questions:

1) how do I change the color of the seek bar (path) from yellow (the default color) to white. What I mean to say is, while I slide the thumb ,

相关标签:
7条回答
  • 2020-11-27 13:21

    Since SeekBar uses colorAccent by default, you can create a new style with your custom color as colorAccent then use theme attribute to apply it to the SeekBar.

    <SeekBar>
        .
        .
        android:theme="@style/MySeekBarTheme"
        .
    </SeekBar>
    

    in the @style:

     <style name="MySeekBarTheme" parent="Widget.AppCompat.SeekBar" >
            <item name="colorAccent">#ffff00</item>
     </style>
    
    0 讨论(0)
提交回复
热议问题