最后一项的分页 3 上的 RecyclerView 正在跳跃

问题描述

我对回收站视图的最后一项有问题(我使用分页 3 来填充数据) 当我触摸任何 where 的项目时,它会跳下来并显示它的一半。 像扔东西一样。

val linearlayoutmanager = linearlayoutmanager(mContext)
    ordersAdapter = OrdersCurrentMainAdapter(mContext,this)
    binding.currentOrdersRv.apply {
        adapter = ordersAdapter
        layoutManager=  linearlayoutmanager
        setHasFixedSize(true)
    }

此外,我在主 recyclerview 的每个项目中有两个 recyclerview.. 将它们添加到主回收器视图项的绑定方法的视图中 类 OrderCurrentMainViewHolder( val mContext:上下文, 查看:查看, val mCallBack: CurrentOrderFragment ) : RecyclerView.ViewHolder(view) { 私有 val _tAG = FoodsViewHolder::class.java.simpleName

var foodsList: RecyclerView = itemView.findViewById(R.id.foods_list_current_order_layout)
var productsList: RecyclerView = itemView.findViewById(R.id.products_list_current_order_layout)


private lateinit var foodsItem: DataItem

fun bind(foodItem: DataItem?) {
    if (foodItem == null) {

    } else {
        showRepoData(foodItem)
    }
}

private fun showRepoData(item: DataItem) {
    this.foodsItem = item



    val foodList = mutablelistof<FoodsItem?>()
    item.foods?.toMutableList()?.let {
        foodList.addAll(it)
    }
    var foodsAdapter = OrderCurrentSubFoodsAdapter(mContext,foodList,mCallBack)
    foodsList.adapter = foodsAdapter
    foodsList.layoutManager = linearlayoutmanager(mContext)
    foodsList.layoutDirection = View.LAYOUT_DIRECTION_LOCALE
    foodsList.setHasFixedSize(true)

    val productList = mutablelistof<String?>()
    var productsAdapter = OrderCurrentSubProductsAdapter(mContext,productList)
    productsList.adapter = productsAdapter
    productsList.layoutManager = linearlayoutmanager(mContext)
    productsList.layoutDirection = View.LAYOUT_DIRECTION_LOCALE
    productsList.setHasFixedSize(true)

}

gif file for jumping item

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...