ImageView rounded corners

后端 未结 17 2021
长发绾君心
长发绾君心 2020-11-27 15:33

I wanted image to have rounded corners. I implement this xml code and use this in my image view. but image overlap the shape. I am downloading the image through async task.<

17条回答
  •  再見小時候
    2020-11-27 16:24

    Based on Nihal's answer ( https://stackoverflow.com/a/42234152/2832027 ), here is a pure XML version that gives a rectangle with rounded corners on API 24 and above. On below API 24, it will show no rounded corners.

    Usage:

    
    

    rounded_corner_mask.xml

    
    
    
        
            
                
            
        
    
        
            
                
            
        
    
        
            
                
            
        
    
        
            
                
            
        
    
    
    

提交回复
热议问题