android - RecyclerView 在滚动时覆盖 ImageView
问题描述
我有一个RecylerView
低于ImageView
:
我希望在用户向下RecyclerView
滚动ImageView
列表时滚动。如果他们滚动回顶部,ImageView
则应显示。我知道我可以通过将 添加ImageView
到项目列表来完成此操作,但我不希望ImageView
与列表一起滚动,它应该保持原位并RecylerView
覆盖它。
这就是我的布局:
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/episodes_list_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/episode_list_thumbnail"
android:layout_width="match_parent"
android:layout_height="40dp"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/episode_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintTop_toBottomOf="@+id/episode_list_progress_text_thumbnail"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
此项目列表正在填充自定义项,RecyclerView.Adapter
但我不确定这是否相关。
解决方案
推荐阅读
- python - 如何使用来自另一个数据帧的列和索引号更新熊猫数据帧?
- c - 向数组中添加超过 1 项时 C 程序中的分段错误
- kotlin - 使用委托从 kotlin 接口派生的类中序列化对象列表
- javascript - 在地图内拟合边界
- c++ - 为什么 C++ 整数检查器不能正常工作?
- c# - 在大型 Unity/C# 游戏中过滤通用集合的理想性能
- flutter - 当我在 Android Studio 中增加 sd 卡内存时,模拟器从 AVD 管理器中删除
- html - 未显示用户名文本输入
- oauth - JavaMail oauth 需要完整的邮件范围才能通过 gmail 发送电子邮件
- mysql - Mysql/Doctrine - 检查月份是否在两个日期之间