gpt4 book ai didi

android - Cardview,cardCornerRadius 不工作

转载 作者:太空狗 更新时间:2023-10-29 15:45:19 27 4
gpt4 key购买 nike

我正在尝试为我的卡片设置一个 cardCornerRadius 但它不起作用。

看看下面我的代码:

CardView 其中最后一个属性是 cardCornerRadius

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/user_card_view"
android:layout_width="match_parent"
android:layout_height="@dimen/card_height"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/md_keylines"
android:layout_marginLeft="@dimen/md_keylines"
android:layout_marginRight="@dimen/md_keylines"
android:foreground="?attr/selectableItemBackground"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:cardCornerRadius="3dp">

依赖关系

compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0' compile 'com.android.support:cardview-v7:23.3.0'

我在控制台中没有收到任何错误,所以我真的不知道发生了什么。

知道怎么做吗?

谢谢!

最佳答案

我认为您可能在代码中使用了setBackgroundColor

如果是这样,请尝试改用 setCardBackgroundColor

关于android - Cardview,cardCornerRadius 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36779133/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com