java - Java Android 删除回收站中的项目大纲
问题描述
我正在开发一个在我的 Firebase 实时数据库中搜索用户的活动,并且我正在使用 cradview 作为扩展的布局:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="90dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:backgroundTint="#FFFFFF"
android:elevation="0dp"
android:layout_marginBottom="20dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.cardview.widget.CardView
android:id="@+id/crdProfileImage"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
app:cardBackgroundColor="@color/textC"
app:cardCornerRadius="30dp">
<ImageView
android:id="@+id/imgHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/user_default"
android:scaleType="centerCrop"/>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/txtUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="@color/black"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:layout_toEndOf="@+id/crdProfileImage"
android:layout_marginLeft="25dp"
android:textSize="25dp"/>
<TextView
android:id="@+id/txtBio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_alignStart="@+id/txtUsername"
android:layout_marginTop="35dp"
android:text="Hi, this is my biography."/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
但是,我注意到当 recyclerview 输出项目时,项目会出现一个轮廓:
我以为是海拔,所以我在recyclerview和cardview的布局上都设置为0,但结果没有改变。有人知道如何解决吗?
编辑:
我试图删除边距底部,但它仍然显示高度:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="90dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:backgroundTint="#FFFFFF"
card_view:cardElevation="0dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.cardview.widget.CardView
android:id="@+id/crdProfileImage"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
app:cardElevation="0dp"
app:cardBackgroundColor="@color/textC"
app:cardCornerRadius="30dp">
<ImageView
android:id="@+id/imgHolder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/user_default"
android:scaleType="centerCrop"/>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/txtUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Username"
android:textColor="@color/black"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:layout_toEndOf="@+id/crdProfileImage"
android:layout_marginLeft="25dp"
android:textSize="25dp"/>
<TextView
android:id="@+id/txtBio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_alignStart="@+id/txtUsername"
android:layout_marginTop="35dp"
android:text="Hi, this is my biography."/>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
解决方案
利用
card_view:cardElevation="0dp"
代替
android:elevation="0dp"
推荐阅读
- asp.net-identity - 在自定义 SignInManager (ASP.NET Core 2) 中覆盖 PasswordSignInAsync
- bootstrap-4 - 带有 BS4 输入组前置的引导程序选择
- python - 如何使用 DatetimeField 列在 Django 中获取过去 7 天中每个小时的最后一个对象?
- mysql - nodejs通过准备好的语句与mysql类似的查询抛出错误
- openshift - Openshift 管道失败并出现错误:# is already in progress (Running)
- tensorflow - 时代花费越来越多的时间
- amazon-web-services - (Bug) Elasticloadbalancer 找不到带有 arn cloudformation 的 ACM 证书
- opencv - OpenCV 在帧捕获时设置错误的相机分辨率
- python-3.x - 比较两个数组并获取不常见的值
- linux - Imagemagick ftp 和空间