Custom seekbar (thumb size, color and background)

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

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

This is my seekbar :



        
10条回答
  •  清酒与你
    2020-11-28 04:28

    All done in XML (no .png images). The clever bit is border_shadow.xml.

    All about the vectors these days...

    Screenshot:


    This is your SeekBar (res/layout/???.xml):

    SeekBar

    
    

    Let's make it stylish (so you can easily customize it later):

    style

    res/drawable/seekbar_style.xml:

    
    
        
        
    
         
            
        
    
    

    thumb

    res/drawable/custom_thumb.xml:

    
    
        
            
                
                
            
           
    
    

    progress

    res/drawable/seekbar_progress.xml:

    
    
        
            
                
                    
                    
                            
                
            
        
    
    

    shadow

    res/drawable/border_shadow.xml:

    
           
              
             
                
                          
             
        
    
    

提交回复
热议问题