一些drawable的用法

1 shape



 
    
    
    
    
    

2 LayerDrawable用于progressDrawable

progress——drawable


    
        
            
            
        
    
    
        
            
                
                
            
        
    
    
        
        
            
            
        
        
    

progressbar的背景,padding=2dp之内填充progressdrawable,外面形成2dp的的边框


  
    
    
    

3 stateList也就是selector

4LevelListDrawable



    
    



    
    


    


            iv.setImageLevel(level);//切换前景图
            LevelListDrawable levelListDrawable= (LevelListDrawable) iv.getBackground();
            levelListDrawable.setLevel(level);//切换背景图

4TransitionDrawable



    
    


 TransitionDrawable transitionDrawable = (TransitionDrawable) tv.getBackground();
            transitionDrawable.startTransition(1000);

你可能感兴趣的:(一些drawable的用法)