各位先进晚安,小鲁最近在实作类似Between回忆录的功能
小鲁原本是将ImageView放进CardView中实现的,
但后来发现这与Between的回忆录不同(个人认为Between的会比较好看)
而我与Between的不同在于,他的图片其实会跑出CardView之外,
因次我试着将ImageView放到外层的Layout中,但却发现ImageView会被CardView所覆蓋
因此想上来请教,是否有方法或是关键字查询能让小鲁知道如何将ImageVIew显示到最上
方
麻烦各位大德伸出援手了!
(下图为本人实作)
https://i.imgur.com/uFYyWEA.jpg
(下图为Between样板)
https://i.imgur.com/cqwaOPv.jpg
附上XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schem
as
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/c1"
android:layout_width="match_parent"
android:layout_height="325dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="275dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/Card">
<ImageView
android:id="@+id/Picture"
android:layout_width="match_parent"
android:layout_height="275dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/baseline_insert_photo_white_18dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:id="@+id/Card"
android:layout_width="375dp"
android:layout_height="300dp"
app:cardElevation="30px"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_gravity="bottom"
android:layout_marginLeft="350dp"
android:alpha="0.5"
android:background="@drawable/baseline_more_vert_black_18dp" />
<TextView
android:id="@+id/textView6"
android:layout_width="92dp"
android:layout_height="34dp"
android:layout_gravity="bottom"
android:alpha="0.2"
android:background="@drawable/lider2"
android:textStyle="italic" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="350dp"
android:layout_height="275dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="30dp">
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>