How to make layout with rounded corners..?

后端 未结 18 3266
独厮守ぢ
独厮守ぢ 2020-11-22 09:37

How can I make a layout with rounded corners? I want to apply rounded corners to my LinearLayout.

18条回答
  •  佛祖请我去吃肉
    2020-11-22 09:59

    A better way to do it would be:

    background_activity.xml

    
    
        
            
        
        
            
                
                
                
            
        
    
    

    This will work below API 21 also, and give you something like this:


    If you are willing to make a little more effort more better control, then use android.support.v7.widget.CardView with its cardCornerRadius attribute (and set elevation attribute to 0dp to get rid of any accompanying drop shadow with the cardView). Also, this will work from API level as low as 15.

提交回复
热议问题