kingjiajie / JJCollectionViewRoundFlowLayout_Swift

JJCollectionViewRoundFlowLayout_Swift是JJCollectionViewRoundFlowLayout(OC:https://github.com/kingjiajie/JJCollectionViewRoundFlowLayout )的Swift版本,JJCollectionViewRoundFlowLayout可设置CollectionView的BackgroundColor,可根据用户Cell个数计算背景图尺寸,可自定义是否包括计算CollectionViewHeaderView、CollectionViewFootererView或只计算Cells。设置简单,可自定义背景颜色偏移,设置显示方向(竖向、横向)显示,不同Section设置不同的背景颜色,设置Cell的对齐方式,支持左对齐,右对齐,居中。
MIT License
73 stars 13 forks source link

当每组单元格数量为0时,组头背景色就会失效 #4

Closed BeingCode closed 3 years ago

kingjiajie commented 3 years ago

您好,你的需求这边是需要如果没有对应cell的时候,也给header或者footer进行计算么?

BeingCode commented 3 years ago

@kingjiajie 有可能组头有数据cell为空的情况

kingjiajie commented 3 years ago

此前我是限制了这个方案的,这几天我将这个方案也更新上去吧。

BeingCode commented 3 years ago

@kingjiajie 非常感谢

kingjiajie commented 3 years ago

@kingjiajie 有可能组头有数据cell为空的情况

该方案已经进行添加。 使用该方案有地方需要注意的: 1、就是Cell个数为0的时候,需要手动开启计算(默认不进行计算的 ) 2、该方案下计算的header&footer还是会受到设置的“header&footer标识或代理影响,控制哪写section进行计算” 3、该方案下,需要特别注意sectionInset设置,当存在header&footer,但Cell个数为0时,计算方式会进行sectionInset计算,从而可能会出现应设置了系统的sectionInset,而看上去header&footer底色多出来了sectionInset的偏移。(当Cell个数为0时,可将对应section的 sectionInset top、bottom设置为0, 或者在JJControlviewFlowLayout上设置回补偏移进行处理。)