How to make a view with rounded corners?

前端 未结 20 1308
遇见更好的自我
遇见更好的自我 2020-11-27 11:08

I am trying to make a view in android with rounded edges. The solution I found so far is to define a shape with rounded corners and use it as the background of that view.

20条回答
  •  借酒劲吻你
    2020-11-27 11:27

    You can use an androidx.cardview.widget.CardView like so:

    
    
           ...
    
    
    

    OR

    shape.xml

    
    
        
    
        
    
        
    
        
    
    
    

    and inside you layout

    
    
            ...
    
    
    

提交回复
热议问题