CymChad / BaseRecyclerViewAdapterHelper

BRVAH:Powerful and flexible RecyclerAdapter
http://www.recyclerview.org/
MIT License
24.2k stars 5.14k forks source link

QuickGridLayoutManager空布局无法撑满 #3818

Closed ChaoyuZhu closed 7 months ago

ChaoyuZhu commented 7 months ago

使用版本4.0.3

singleSpecAdapter = new SingleSpecAdapter(); singleSpecAdapter.submitList(collect); singleSpecAdapter.setStateViewEnable(true); singleSpecAdapter.setStateViewLayout(requireContext(), R.layout.adapter_single_spec_empty); viewBinding.recyclerViewSpec.setLayoutManager(new QuickGridLayoutManager(requireContext(), 3)); viewBinding.recyclerViewSpec.setAdapter(singleSpecAdapter);

使用以下代码后,发现空布局无法撑满。之前使用其他版本是可以的。

ChaoyuZhu commented 7 months ago

找到问题,请在你的适配器中添加 implements FullSpanAdapterType。

ChaoyuZhu commented 7 months ago

坏了,实现FullSpanAdapterType这个接口后,1个item也会撑满整个宽度了。还是有问题。

limuyang2 commented 7 months ago

更新下最新版本试下呢

ChaoyuZhu commented 7 months ago

微信图片_20231130152012

我更新到了最新版本,代码如下: recipeAdapter.setStateViewEnable(true); recipeAdapter.setStateViewLayout(requireContext(), R.layout.adapter_recipe_empty); viewBinding.recyclerView.setLayoutManager(new QuickGridLayoutManager(requireContext(), 2)); viewBinding.recyclerView.setAdapter(recipeAdapter);

依旧空布局无法撑满

ChaoyuZhu commented 7 months ago

我回退到4.0.2就没有问题,4.0.3和这个最新版都不行。老哥快修复。

limuyang2 commented 7 months ago

已经在 4.1.1 版中修复