drawble文件夹下面新建,xxx.xml内容如下

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:angle="200"
        android:centerColor="#EBFDEF"
        android:endColor="#EBFDEF"
        android:startColor="#A3FCB5" />
    <corners android:radius="30dp" />
</shape>

效果如下图

如果说,我只要下面两个是圆角,这样就可以

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient
        android:angle="200"
        android:centerColor="#EBFDEF"
        android:endColor="#EBFDEF"
        android:startColor="#A3FCB5" />
    <corners
        android:topLeftRadius="0dp"
        android:topRightRadius="0dp"
        android:bottomRightRadius="20dp"
        android:bottomLeftRadius="20dp"
        />

</shape>

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐