RecyclerView小部件是ListView和GridView的更高级和灵活的版本。
在Android RecyclerView中如何更改交替行的颜色
我是android新手,最近我学习了recyclerview,我想改变行的颜色。 示例:我有 10 行,我想更改颜色,例如 5 行蓝色和 5 行红色。交替行
我的适配器部分有一个进度条,我想从活动部分更改它。 适配器 接口PreparedOnItemDetailClickListener { 有趣的点击( 订单详情:
(水平)ScrollView 还是 RecyclerView 在这种情况下?
我有一个复杂对象的列表。每个对象都有大量信息,这些信息不断从后端网络服务器更新。我预计通常会处理 50-100 个这样的对象。 现在,每个对象...
ListAdapter:提交List后未重新绑定项目单击侦听器
我对 ListAdapter 有一个问题,尽管它可能按预期工作,但对我来说却成了一个错误。 假设我有这个数据类 数据类 AssetMinDataDomain( 有效 ID:字符串 = &qu...
我为我的 android peoject geeksforgeeks 遵循了这个教程,它起作用了。 但是,我想为我的项目添加更多功能。 查看 geeksforgeeks.org 上的教程并告诉我如何制作
我尝试将recyclerview与自定义工具栏和底栏一起使用,但两者都是重叠的recyclerview,即使我在xml中使用了constraintTop_toBottomOf和constraintBottom_toTopOf ...
使用 Google Firebase 从 Recycler View 列表中删除数据
我正在构建一个连接到 Google Firestore 的应用程序,该应用程序允许用户从 Recycler View 列表中添加和删除电视节目数据。我的问题是试图删除数据...
ListAdapter currentList 和 itemCount 在筛选或提交列表后不返回更新
我正在使用 ListAdapter 和实现 Filterable 的 AsyncDifferConfig.Builder 为 RecyclerView 实现可过滤列表。当搜索没有结果匹配时,将显示一个 TextView。 适配器。
除非我向下滚动 RecyclerView Android Kotlin,否则来自 SharedPreferences 的数据不会更新
问题是,当我第一次单击“添加到收藏夹”按钮时,图像发生变化,并且数据被保存到 SharedPreferences 中。然而,当我再次点击同一个按钮时,
findFirstVisibleItemPositions 不适用于 recycleview android
我有这个代码: mRecycleView.setOnScrollListener(new RecyclerView.OnScrollListener() { @覆盖 公共无效onScrolled(RecyclerView recyclerView,int dx,int dy){ 超级.onScroll...
Android 更改 onCreateViewHolder() 从自定义回调返回 viewHolder
我想异步返回recyclerview onCreateViewHolder()中的viewHolder。 开始时,viewHolder 应该像第一行一样(并且一直有效),但是一旦我的回调被调用
我正在recyclerView中执行分页。我的数据已成功加载,问题是如何向服务器请求下一页。我如何执行分页以及如何找到页码...
我获取了一份报价列表(OfferBaseModel)。优惠可以有两种类型“个人”或“收藏夹”。现在我想在选项卡选择上显示这些 公开课 OfferBaseModel -> 父类 数据集...
如何将带有文本的分隔符或间隔符添加到动态适应状态属性的recyclerview
我有一个显示数据列表的 RecylerView。我需要添加分隔符或间隔符,我还需要添加两个分隔符或间隔符,以便我可以添加文本 [当前和邀请] 标题应该
我正在开发一个类似于电子商务应用程序的应用程序。用户可以将产品添加到购物车。 我有两个下面提到的数组列表。 公共ArrayList购物车列表=新ArrayList<...
我有无限滚动的RecyclerView,当滚动到最后一个项目时,可以从API加载更多项目,但是在几次滚动之后,我的RecyclerView开始滞后于添加新项目并获取 S...
包裹在 CoordinatorLayout 内的 RecyclerView 在键盘打开时未调整大小
活动布局xml: 活动布局xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:expandedTitleMarginEnd="64dp" app:expandedTitleMarginStart="48dp" app:layout_scrollFlags="scroll"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" app:layout_collapseMode="parallax"> <ImageView android:layout_width="match_parent" android:layout_height="250dp" android:scaleType="centerCrop" android:src="@drawable/hospital_logo" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:orientation="vertical" android:padding="10dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="******* ************* ********** ************" android:textSize="18sp" android:textColor="@android:color/black" android:textStyle="bold"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="***************************" android:textSize="18sp" android:textColor="@android:color/black" android:textStyle="bold"/> </LinearLayout> </FrameLayout> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> </android.support.design.widget.CollapsingToolbarLayout> <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed" /> </android.support.design.widget.AppBarLayout> <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </android.support.design.widget.CoordinatorLayout> 这里我将 CoordinatorLayout 与 CollapsingToolbarBar 和 ViewPager 一起使用。 我在 ViewPager 中添加了两个带有布局 xml 的片段: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" /> </LinearLayout> recycler_view 的单元格包含 EditText。当我选择 EditText 时,软键盘打开,但 EditText 隐藏在键盘后面。 我已在活动中添加了以下标志: android:windowSoftInputMode="adjustResize" 我正在使用 23.1.1 appcompat 版本的 RecyclerView。 当我用 CoordinatorLayout 替换 LinearLayout 时,RecyclerView 正在调整大小以正确显示最后一个元素。所以我认为这是协调器布局的问题。 我遇到了以下问题https://code.google.com/p/android/issues/detail?id=176406和https://code.google.com/p/android/issues/detail?id =176187 但这与这个错误无关。让我知道我是否可以应用某种路径来解决这个问题。 等待回复。谢谢。 如果需要更多详细信息,请告诉我。 有一个非常相似的问题,并且能够通过使用 android:windowSoftInputMode="adjustPan" 来修复它 我遇到了类似的问题coordinatorLayout。但是,将 fitsSystemWindows 设置为 false 解决了问题。看来罪魁祸首是coordinatorLayout。我通过将整个布局(包括 AppBarLayout)封装在 constraintLayout 中解决了这个问题。 <androidx.coordinatorlayout.widget.CoordinatorLayout> <androidx.constraintlayout.widget.ConstraintLayout <com.google.android.material.appbar.AppBarLayout </com.google.android.material.appbar.AppBarLayout //content here </androidx.constraintlayout.widget.ConstraintLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout> 我知道回复这个帖子来得很晚,但也许对其他人有帮助。 :)
我在我的程序中制作了一个垂直的回收器视图。当我单击任何 recyclerView 项目时,我看不到单击监听器正在工作。这是我的 Adapter 类的代码: 类 BoardItemsAdapter(p...
如何向 recyclerview 添加分隔符、间隔符或带有文本的标题
我有一个显示数据列表的 RecylerView。我需要添加分隔符或间隔符,我还需要添加两个分隔符或间隔符,我可以添加文本,如下图所示(带有
我想实现快速滚动,因为现在当代码达到以下位置时非常滞后: holderOneElement.noteTitleText.setText(noteItem.getNoteTitle()); holderOneElement.note详细...