android:实现圆角效果

activity本身没有圆角相关的属性,但可以通过以下方法实现圆角效果,步骤如下:

  1. 在res/drawable下创建xml文件,我命名rounded_corners.xml

 	
 	
 	
     
    
     

其中,shape元素来定义背景的形状。solid元素设置了背景的颜色,corners 元素设置了圆角的半径。stroke元素设置了边框。

  1. 在布局文件中应用该背景。

你可能感兴趣的:(android开发,android)