java - 带圆角的卡片视图具有灰色背景
问题描述
我已经为这个问题寻找解决方案几个小时了,我知道有些人在我之前遇到过这个问题,但他们的解决方案对我不起作用。例如app:cardUseCompatPadding="true"
,不会删除灰色背景,并且 CardElevation 已经设置为 0dp。在这一点上我只是不知道我还能做什么,我希望有人能帮助我:c
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cardview1"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="50dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="225dp"
android:layout_marginBottom="225dp"
app:cardCornerRadius="20dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/colorRedDark">
<RelativLayout>
.
.
.
</RelativeLayout>
</androidx.cardview.widget.CardView>
解决方案
推荐阅读
- r - R - 重新排序 NULL 列
- mysql - mysql 触发器中的 if else 块中的 Use Case 语句
- sql - 按非主键属性分组 min(Value) 并从同一行加入附加属性(使用原始 SQL 或 SQLalchemy)
- laravel - 提交表单vue后重定向到主页
- azure - 如何正确将 ASPNETCORE_ENV 设置为非开发值?
- ruby - 即使捆绑安装运行良好,gem 中的加载错误
- sql-server - 对于具有 IDENTITY 列的表上的 INSTEAD OF 触发器,如何处理 IDENTITY_INSERT?
- c# - TcpListener 在 UWP 应用程序上不起作用
- r - 为什么 R 中的 mtcars 数据集中没有汽车名称的列名?
- haskell - Haskell、Ocaml、Javascript 中的语句与表达式