Custom seekbar (thumb size, color and background)

前端 未结 10 2322
醉梦人生
醉梦人生 2020-11-28 04:07

I would like to have this seekbar in my Android project :

This is my seekbar :



        
10条回答
  •  Happy的楠姐
    2020-11-28 04:38

    You can use the official Slider in the Material Components Library.

    Use the app:trackHeight="xxdp" (default value is 4dp) to change the height of the track bar.

    Also use these attributes to customize the colors:

    • app:activeTrackColor: the active track color
    • app:inactiveTrackColor: the inactive track color
    • app:thumbColor: to fill the thumb

    Something like:

        
    

    It requires the version 1.2.0 of the library.

提交回复
热议问题