问题描述
我对回收站视图的最后一项有问题(我使用分页 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)
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)