小编Jua*_*nje的帖子

具有不同拐角半径的CardView

我有以下CardView,并且我想为卡中的每个角设置不同的半径。是否可以通过XML或以编程方式更改它们?提前致谢。

<android.support.v7.widget.CardView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginRight="16dp"
    android:layout_marginLeft="16dp"
    android:layout_marginTop="5dp"
    android:layout_marginBottom="5dp"
    app:cardCornerRadius="0dp"
    app:cardElevation="0dp">
</android.support.v7.widget.CardView>
Run Code Online (Sandbox Code Playgroud)

编辑 正如阿维纳什(Avinash)所建议的那样,我正在寻找此lib github.com/captain-miao/OptionRoundCardview的行为,但使用默认的CardView项目。如果无法单独更改它,则此lib是一个不错的方法。

android android-layout material-design android-cardview material-components-android

4
推荐指数
1
解决办法
4400
查看次数