RecyclerView小部件是ListView和GridView的更高级和灵活的版本。
我正在使用 Realm 使用 OrderedRealmCollection 从 MongoDB 获取数据,但什么也没得到
在记录时我发现我得到一个空列表 我是初学者,所以请让我知道我犯了哪些错误,我真的需要让它发挥作用。 包com.example.hospital; 导入 android.annota...
ExoPlayer 未显示视频。我可以收听音频,但无法播放视频。我在 Recyclerview 中使用 Exoplayer。我只能看到黑屏并听音频。我无法
将 Arryaylist 作为共享首选项保存到 json 后,在 Fragment 中实现 RecyclerView 时遇到问题
我无法显示片段,但我的活动中没有显示任何内容。我的目标是将sharedpreference保存为gson,因为arraylist无法保存到sharedpreference中然后使用gson...
我正在尝试从回收器视图中的 Api 获取图像数据,但以下代码在回收器视图中按 Id 查找视图时出现错误 以下代码是获取数据的活动
我是android studio的新手。在 recyclerview 适配器中使用绑定时,出现以下错误:缺少带 ID 的所需视图 E/AndroidRuntime:致命异常:main 进程:com.example.
在我的应用程序中,我有垂直父级 RecyclerView,其 ViewHolders 内有几个水平子级。但我有一个非常烦人的滚动问题 - 在我垂直滚动父 RV 后,我想...
RecyclerView 中 onBindView 上的 setAlpha() 在首次显示时不起作用
在 RecyclerView.Adapter 中使用以下代码: onBindViewHolder(VH 持有者, int 位置){ holder.itemView.setAlpha(0.5f); } 第一次显示该项目时不会显示 Alpha。哈...
在 React 本机 UI 组件中使用 RecyclerView 时“无法找到 receiveTouches 的 EventEmitter”
我有一个 React 本机 UI 组件,它使用 RecyclerView 来显示可滚动的卡片列表。 我这样定义我的视图: 公共类 ListView 扩展 LinearLayout { 自定义回收器视图
NestedRecyclerView 中分散 TouchEvent 的注意力
我有一个嵌套的RecyclerView。我将它们称为 ParentRecyclerView 和 ChildRecyclerView。 我的目标有点复杂。 如果我点击ParentRecyclerView的项目,那么ParentRecyclerVie的颜色...
我想将row_center_list.xml放在fragment_center的名为gym_list_recycler的recyclerView中。我不知道,因为 gpt 说没有代码错误。我遵循 ChatGPT 告诉的每一个步骤。我...
当我们更改主题时,适配器会变为 null,并且当我们使用 addTask 函数时,应用程序会崩溃
包com.example.myapplication; 导入 android.content.Context; 导入 android.os.Bundle; 导入 androidx.annotation.NonNull; 导入 androidx.fragment.app.Fragment; 导入 androidx.recyclerview....
如何在Android RecyclerView适配器中过滤后获取原始项目位置?
我在android recyclerview适配器中实现了过滤器。但问题是,当我过滤项目时,项目的位置发生了变化。我需要过滤后项目的原始位置?我怎样才能得到...
有没有办法让RecyclerView的requiresFadingEdge不受paddingTop和paddingBottom影响
目前,我需要在我的第一个RecyclerView项目和最后一个项目中使用RecyclerView的paddingTop和paddingBottom,因为我想避免复杂的空间计算。 不过,我注意到,
我正在开发一个简单的记事本应用程序,首先我使用listView来显示所有笔记。但现在我使用RecyclerView。当我使用 listview 时,我使用 OnItemClickListener 将数据传递给另一个 ac...
我有一个用于两种不同类型的类别的选项卡布局:收入和费用。我使用 CategoriesViewModel 获取所有类别,并观察列表是否有任何更改。当选择一个选项卡时...
我有 ViewPager2 和 3 个片段,并且所有片段都有 recyclerview,但在中间片段 recyclerview 中,如果我尝试触摸 recyclerview 项目,则不会滚动,但如果我触摸右或左 si,它会平滑滚动...
如何使从回收器视图中拖动的项目出现在目标上方而不是消失在其下方?
我有一个回收视图和一个图像视图。我希望能够将列表中的项目拖到图像视图的顶部(然后将其放下)。 问题是,当我拖动该项目时,它会消失......
这是我的布局: 这是我的布局: <androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" tools:context=".ScannerFragment"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <androidx.camera.view.PreviewView android:id="@+id/cameraPreview" android:layout_width="match_parent" android:layout_height="0dp" app:layout_constraintDimensionRatio="16:9" app:layout_constraintTop_toTopOf="parent" /> <ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_constraintTop_toBottomOf="@id/cameraPreview"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/saleList" android:layout_width="match_parent" android:layout_height="wrap_content" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> </ScrollView> <View android:id="@+id/filler" android:layout_width="match_parent" android:layout_height="0dp" app:layout_constraintTop_toBottomOf="@id/scrollView" app:layout_constraintVertical_weight="1" /> <androidx.appcompat.widget.LinearLayoutCompat android:id="@+id/total_widget" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="4dp" app:layout_constraintBottom_toBottomOf="parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/total" android:textSize="24sp" /> <View android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" /> <TextView android:id="@+id/sum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="24sp" /> </androidx.appcompat.widget.LinearLayoutCompat> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.appcompat.widget.LinearLayoutCompat> 这就是它的样子: 请查看图像底部,RecyclerView 中的项目是否覆盖了“Total”文本。我希望 RecyclerView 最多扩展至“Total”文本的顶部。 问题是,即使 RecyclerView 为空,我也希望“Total”文本粘在广告上方的底部。因此我不能简单地以这种方式限制它。 我尝试了“填充”视图的各种约束,但这也无法正常工作。在某些情况下,添加到 RecyclerView 的项目会使 RecyclerView 从 CameraPreview 和“Total”文本之间的中间展开。只是最终覆盖了 CameraPreview 和“Total”文本... 是否有一种有意识的方法来实现我想要的布局,而无需无休止地摆弄它? 几件事: 1)Recyclerviews 内置了滚动功能。无需将其放入 ScrollView 中。 2)向RecyclerView添加constraint_bottom_toTopOf(在删除滚动视图之后)并将其限制在您不希望它重叠的任何视图之上(我假设是total_widget)
子RecyclerView项拦截父RecyclerView项的点击事件
父项目单击 子项目点击 我有一个父 RecyclerView,里面有嵌套的子 RecyclerView 项目。问题是我只点击了父项的非子RecyclerView部分...
我创建了动态视图的数组列表,其中包含一个微调器和两个编辑文本,通过为其创建模型类动态添加到数组列表中。将视图添加到列表是wo...