Changing size of seekbar thumb

前端 未结 8 2051
小鲜肉
小鲜肉 2020-12-02 18:33

I\'m using a drawable for seekbar thumb with

android:thumb=\"@drawable/thumb\"

How can I set the size of this thumb in dip

8条回答
  •  日久生厌
    2020-12-02 19:14

    The most flexible way to set thumb size for me is to create layered-drawable with shape as placeholder thumb_image.xml:

    
    
        
            
                
    
                
            
        
        
    
    
    

    So basically changing the size of shape will stretch drawable, the shape is transparent so it won't be visible. Also the minimum size of such thumb is size of bitmap.

    Here is example of layout:

    
    
    
    

    Seek bar with different thumb size

提交回复
热议问题