Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuickGridLayoutManager空布局无法撑满 #3818

Closed
ChaoyuZhu opened this issue Nov 14, 2023 · 7 comments
Closed

QuickGridLayoutManager空布局无法撑满 #3818

ChaoyuZhu opened this issue Nov 14, 2023 · 7 comments

Comments

@ChaoyuZhu
Copy link

使用版本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
Copy link
Author

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

@ChaoyuZhu ChaoyuZhu reopened this Nov 14, 2023
@ChaoyuZhu
Copy link
Author

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

@limuyang2
Copy link
Collaborator

更新下最新版本试下呢

@ChaoyuZhu
Copy link
Author

微信图片_20231130152012

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

依旧空布局无法撑满

@ChaoyuZhu
Copy link
Author

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

@limuyang2
Copy link
Collaborator

已经在 4.1.1 版中修复

@wangzhongITger
Copy link

已经在 4.1.1 版中修复

4.1.4还有这个问题怎么回事呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants