1、渐变实体背景+圆角:
应用场景:按钮
<shape>
<gradient
android:endColor="@color/theme_24A7F2"
android:startColor="@color/theme_1AC6FF"
android:type="linear" />
<corners
android:bottomLeftRadius="100dp"
android:bottomRightRadius="100dp"
android:topLeftRadius="100dp"
android:topRightRadius="100dp" />
</shape>
2、不带渐变的实体弧角shape
应用场景:弹窗,对话框
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="12dp" <!-- 左上角 -->
android:topRightRadius="12dp" <!-- 右上角 -->
android:bottomLeftRadius="12dp" <!-- 左下角 -->
android:bottomRightRadius="12dp"/> <!-- 右下角 -->
<solid
android:color="#24A7F2"/>
</shape>
3、带边框的圆角shape
应用场景:按钮
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00000000" /><!-- 背景填充颜色 -->
<stroke
android:width="2dp"
android:color="#FF5252" /><!-- 描边,边框宽度、颜色 -->
<corners android:radius="100dp" /><!-- 边角圆弧的半径 -->
</shape>