How to make layout with rounded corners..?

后端 未结 18 3252
独厮守ぢ
独厮守ぢ 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 10:13

    The best and simplest method would be to make use of card_background drawable in your layout. This also follows Google's material design guidelines. Just include this in you LinearLayout:

    android:background="@drawable/card_background"
    

    Add this to your drawable directory and name it card_background.xml:

    
    
    
        
            
                
                
            
        
    
        
            
                
                
            
        
    
    

提交回复
热议问题