简体   繁体   English

如何将 TextView 放在 Android 中的 RecyclerView 项目上?

[英]How to put a TextView over RecyclerView items in Android?

As shown in below image I made it with RecyclerView .如下图所示,我使用RecyclerView制作了它。
在此处输入图像描述
I want approach to a solution to add a TextView that is shown over the RecyclerView items like the image below.我想要一种解决方案来添加一个 TextView,它显示在 RecyclerView 项目上,如下图所示。
在此处输入图像描述
As you can see this TextView is laid on over two or more items of RecyclerView, so how I can achieve this?如您所见,这个 TextView 放置在两个或多个 RecyclerView 上,那么我该如何实现呢?

  <TextView
      
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Appointment made 8.15-9.15"
        android:textSize="20sp"
        android:textStyle="bold"
        android:background="@android:color/holo_green_light"
        android:textColor="@color/black"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

add this to your activity layout.xml file above recycler view.将此添加到您的活动布局中。xml 文件在回收站视图上方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 android 中的 NestedScrollView 中将 TextView 放在 RecyclerView 下面 - How to put TextView below RecyclerView in NestedScrollView in android 如何在Android Studio中创建文本视图来保存recyclerview中的项目数 - How to create textview that hold the count of items in recyclerview in android studio 显示号码 android studio中textview中的recyclerview项目 - Display no. of items of a recyclerview in a textview in android studio 在recyclerView中编辑TextView项目 - Edit TextView Items in recyclerView 如何在Android中的recyclerView中放置一个recyclerview - How to put a recyclerview inside a recyclerView in android 如何将 label 放在 TextView 的边界上 - How to put a label over the border of the TextView 如何在RecyclerView中显示项目的条件? - How to put condition in showing items in RecyclerView? Android在所有项目中的recyclerview中更改textview而不重绘整个列表 - Android change textview in recyclerview in all items without redrawing the entire list 允许在 android recyclerview 中一次从不同的 textview 项目中选择文本 - Allow selecting text from different textview items at once in android recyclerview 如何在 Android 中访问 RecyclerView 之外的 TextView? - How to access a TextView outside RecyclerView in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM