android - 如何修复 CardView 角半径问题?

标签 android xml android-layout

我正在使用下面的代码来创建 CardView有角,但它保持矩形

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/cardview_id"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:clickable="true"
    android:focusable="true"
    android:foreground="?android:attr/selectableItemBackground"
    card_view:cardCornerRadius="6dp">

更新:我的 list 中有一个错误,我只是删除了这一行:

android:hardwareAccelerated="false"

最佳答案

我也有同样的问题。我发现的问题是...

        android:hardwareAccelerated="false"

从 list 中删除了这一行,问题为我解决了。

关于android - 如何修复 CardView 角半径问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52990652/

相关文章:

android - Google Play 中付费应用的深层链接促销代码

java - 从另一个项目导入类不起作用

xml - 处理 XSLT 中的 namespace 和变量

.net - 是否有用于 .NET 的 XmlEncode/XmlDecode?

java - 在不设置的情况下显示布局边界

android - 如何添加指向 android 菜单的链接?

android - afreechart - ScrollView 中的图表

Android:通过 content://URI 从第三方应用程序(例如 WhatsApp)获取图像位图

android - 数字格式异常 int 无效

xml - 在jsp中显示xml