android-recyclerview 相关问题

RecyclerView小部件是ListView和GridView的更高级和灵活的版本。

将动态添加的回收器视图滚动到位置0

我已动态地将 n 个回收器视图添加到线性布局中。但每个回收器视图在每次启动时都会滚动到结束位置。我希望它们显示在位置 0。 这是我的代码: for(int i = ...

回答 1 投票 0

Android Recycler滚动时查看重复项目

我在 RecyclerView 中遇到问题。当我在 RV 中移动项目然后滚动时,看到一些项目重复了。

回答 5 投票 0

我的 Android 应用程序无法识别我的适配器。没有连接适配器跳过布局

我正在制作一个日记应用程序,每当我尝试使用工具栏上的菜单时,它都会说没有适配器附加跳过布局,并且不允许我将另一个日记添加到我的日记列表(recyclerview)中。

回答 1 投票 0

为什么 ViewPager 不在 CoordinatorLayout 内滚动?

我想做什么? 你好,我正在尝试在我的 Android 应用程序中开发用户配置文件的视图,为此我使用 CoordinatorLayout,在其中我引入 RecyclerView 作为滚动...

回答 1 投票 0

使用recyclerview列出分页

美好的一天,我需要帮助来实现我的回收视图的分页,重点是,如果我向下滚动并到达列表的末尾,那么一切都会正常工作,但如果在第一次这样的滚动之后...

回答 1 投票 0

Android:使用 RecyclerView 和 ListAdapter 修复搜索文本突出显示

我在工具栏中有一个 SearchView,位于 CardView 的 RecyclerView 列表上方。 SearchView 可以正确地根据文本输入过滤列表。然而ListAdapter中的代码...

回答 1 投票 0

Android 中数据库更新时更新 RecyclerView 数据

我正在开发一个Android项目,每当数据库更新时我都需要更新RecyclerView数据。 对于在哪里调用数据库操作,我有两个选项: 在主要活动中 我...

回答 1 投票 0

使用 ItemTouchHelper 向右滑动以显示 RecyclerView 上的按钮

我正在尝试在 RecyclerView 右滑动中显示按钮。我使用这个答案成功地在 RecyclerView 左滑动上显示了这些按钮 但我无法在另一侧显示这些按钮。我试过了...

回答 2 投票 0

无法使用提供的参数调用以下函数 - AsyncListDiffer

我正在创建一个 RecyclerView 适配器。但后来我遇到了 AsyncListDiffer 问题。 无法使用提供的参数调用以下函数 - AsyncListDiffer 如何修复它? 注意适配器....

回答 1 投票 0

RecyclerView 水平多行LinearLayoutManager

我想制作一个布局管理器,以标签云的表示方式表示其项目,如下图所示。 有一些图书馆可以做到这一点,但我只是想学习如何做......

回答 1 投票 0

带有 RecyclerView 的自定义对话框仅显示第一项

在此输入图像描述 我正在尝试在 Android 应用程序中创建一个自定义对话框,该对话框使用 RecyclerView 显示列表。但是,当我运行应用程序时,对话框仅显示第一个...

回答 1 投票 0

如何修复动态更新时RecycleView输出错误

我正在学习android开发,我编写了一个任务调度程序应用程序。我有一个侧边栏,其中的日期至少有 1 个任务。主要活动有一个回收视图,其中显示任务机器人...

回答 1 投票 0

Recycler视图优化

我正在开发一个应用程序,在 viewpager 中有 2 个片段。在第二个片段中,我使用 recyclerview 将图像加载到其中。我面临的问题是关于 UI 阻塞。当我启动...

回答 1 投票 0

Jetpack Compose LazyColumn 的 ItemDecoration 是什么?

在JetpackCompose中,我们可以使用LazyColumnFor作为RecyclerView。 在 RecyclerView 中,为了在项目之间有适当的边距/填充,我们需要使用 ItemDecoration,如本文所述 像下面这样 班级

回答 5 投票 0

在 ViewPager 中滑动删除在片段之间不一致

我正在开发一个 Android 应用程序,其中在单个 Activity 中由 ViewPager 管理的选项卡布局中有两个片段。我遇到了与滑动删除功能不一致的行为...

回答 1 投票 0

如何检测RecyclerView何时滚动到最顶部位置

我上面有RecyclerView,我有一个高度大于255 px的AppBarLayout。当用户滚动 RecyclerView 时,AppBarLayout 出现 fling 问题。为了避免这种情况,我决定扩展 AppBarLa...

回答 3 投票 0

Google 地图 Lite 模式导致 RecyclerView 出现卡顿

我有一个 RecyclerView,它是一个垂直滚动的项目列表。每个列表项都包含一个 Lite 模式下的 Google Maps V2 MapView。我正在利用这个新功能,它会返回位图...

回答 6 投票 0

如何通过按下按钮来滑动 RecyclerView 的项目

我想知道是否可以通过按下 RecyclerView 项目内的按钮来向左滑动该项目。我尝试使用 ItemTouchHelper 的 startSwipe() 函数,但我无法做到...

回答 1 投票 0

Android 回收视图 - 创建动态按钮堆栈

通过我的回收视图,我有 4 种不同的布局,工作正常。我想根据数据在堆栈中添加 x 个按钮的布局。例如,一行可能有 3 个按钮,接下来的 5 个按钮是

回答 1 投票 0

禁用 Recycler View 在 NestedScrollView 内滚动

<?xml version="1.0" encoding="utf-8"?> <layout 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"> <data> </data> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_new_dashboard_gradient_main" android:fitsSystemWindows="true" android:orientation="vertical"> <androidx.appcompat.widget.AppCompatImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:scaleType="fitXY" android:src="@drawable/ic_new_dashboard_bg_lines" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/topToolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="@dimen/siq_20" android:paddingTop="@dimen/siq_60" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <androidx.appcompat.widget.LinearLayoutCompat android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bg_new_dashboard_wallet_fitcoin" android:gravity="center_vertical" android:orientation="horizontal" android:paddingHorizontal="@dimen/siq_16" android:paddingVertical="@dimen/siq_6" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/sponsorImg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:adjustViewBounds="true" android:importantForAccessibility="yes" android:maxWidth="60dp" android:maxHeight="20dp" android:screenReaderFocusable="true" android:src="@drawable/test_logo" tools:tint="@color/primary" /> <androidx.appcompat.widget.AppCompatImageView android:id="@+id/dropDown" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginStart="@dimen/siq_4" android:adjustViewBounds="true" android:importantForAccessibility="yes" android:maxWidth="100dp" android:maxHeight="30dp" android:screenReaderFocusable="true" android:src="@drawable/ic_arrow_down_20" app:tint="#A5A6BB" /> </androidx.appcompat.widget.LinearLayoutCompat> <androidx.appcompat.widget.LinearLayoutCompat android:id="@+id/ficoinAndWallet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bg_new_dashboard_wallet_fitcoin" android:gravity="center_vertical" android:paddingHorizontal="@dimen/siq_16" android:paddingVertical="@dimen/siq_4" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent"> <androidx.appcompat.widget.AppCompatImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" app:srcCompat="@drawable/ic_wallet_new_blue_20" /> <View android:id="@+id/walletDidvider" android:layout_width="1dp" android:layout_height="10dp" android:layout_marginStart="@dimen/siq_8" android:layout_marginEnd="@dimen/siq_5" android:background="#F3F3F3" app:layout_constraintTop_toBottomOf="@id/topToolbar" /> <androidx.appcompat.widget.AppCompatImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_fitcoin_20" /> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/earn_reward_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginStart="@dimen/siq_2" android:fontFamily="@font/inter_bold" android:gravity="center_horizontal" android:text="304" android:textColor="#0F0B28" android:textSize="14sp" /> </androidx.appcompat.widget.LinearLayoutCompat> </androidx.constraintlayout.widget.ConstraintLayout> <View android:id="@+id/dividerTopToolbar" android:layout_width="match_parent" android:layout_height="1dp" android:layout_marginTop="@dimen/siq_16" android:background="#1AF0F3F6" app:layout_constraintTop_toBottomOf="@id/topToolbar" /> <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="0dp" android:fillViewport="true" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@id/dividerTopToolbar"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/topCarouselRv" android:layout_width="match_parent" android:layout_height="wrap_content" android:overScrollMode="never" android:paddingTop="@dimen/siq_6" app:layout_constraintTop_toBottomOf="@id/dividerTopToolbar" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/mainContentRv" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="@dimen/siq_16" android:background="@drawable/bg_new_dashboard_main_rv" android:orientation="vertical" android:overScrollMode="never" android:paddingTop="@dimen/siq_16" android:paddingBottom="@dimen/siq_70" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@id/topCarouselRv" tools:itemCount="50" /> </LinearLayout> </androidx.core.widget.NestedScrollView> <ProgressBar android:id="@+id/progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:indeterminate="true" android:visibility="gone" android:indeterminateTint="#714FFF" android:indeterminateTintMode="src_atop" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/errorLayout" android:layout_width="0dp" android:layout_height="0dp" android:background="@color/white" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/dividerTopToolbar"> <include android:id="@+id/noInternetLayout" layout="@layout/layout_no_internet_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout> </layout> 我有一个 XML 文件,其中一个 NestedScrollView 中有两个 RecyclerView。我的目标是禁用 RecyclerViews 的独立滚动,以便当我尝试滚动时,整个布局作为一个整体滚动。我已经添加了 overScrollMode="never",但 mainContentRv 仍然独立滚动。我也尝试过设置 isNestedScrollingEnabled = false,但这会完全禁用所有视图的滚动行为。有什么办法解决这个问题吗? 您应该在回收器视图上设置 isNestedScrollingEnabled = false,而不是在嵌套滚动视图上

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.