android 控件背景添加圆角

xiaoxiao2021-02-28  101

在drawable创建一个xml文件

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <!--圆角半径--> <corners android:radius="12dp"/> <!--背景颜色,具体颜色自行在color文件设置--> <solid android:color="@color/colorWhite"/> </shape>

 

使用的时候把某个控件的background属性设置为以上的drawable文件

 

 

 

 

转载请注明原文地址: https://www.6miu.com/read-38494.html

最新回复(0)