CHTCollectionViewWaterfallLayout icon indicating copy to clipboard operation
CHTCollectionViewWaterfallLayout copied to clipboard

viewForSupplementaryElementOfKind and referenceSizeForFooterInSection not called?

Open tnahvu opened this issue 10 years ago • 10 comments

Hi

First, thanks for the awesome library! I'm not quite sure how to properly implement footer/header view. Does the normal way not work? Is there something else I need to do ? viewForSupplementaryElementOfKind and referenceSizeForFooterInSection not called when using CHTCollectionViewWaterfallLayout.

Again, many thanks!

tnahvu avatar Sep 11 '15 04:09 tnahvu

  1. viewForSupplementaryElementOfKind will get called, you can see the demo for more information.
  2. referenceSizeForFooterInSection will NOT get called, because it belongs to UICollectionViewDelegateFlowLayout but my CHTCollectionViewDelegateWaterfallLayout confirms to UICollectionViewDelegate.

chiahsien avatar Sep 29 '15 04:09 chiahsien

@chiahsien I get a crash in viewForSupplementaryElementOfKind when dequeueReusableSupplementaryViewOfKind:reuseIdentifier is called. This is the info i have about the crash...

Assertion failure in -[UICollectionViewData layoutAttributesForSupplementaryElementOfKind:atIndexPath:]

I'm setting the footer height property of the layout like you say to do. What am i missing here? By the way I am changing between this layout and another layout which shows my cells in a tableview style layout, and when I am in that layout my footer view shows up just fine.

Gman9855 avatar Mar 24 '16 00:03 Gman9855

@Gman9855 Have you figured out the problem, cuz I'm facing exactly the same problem.

cheriaa avatar Mar 25 '16 17:03 cheriaa

@cheriaa I've gotten it to at least not crash now. You have to register the UICollectionReusableView class first. So now what I have is the extra space I provided to the layout's footerHeight property, but the supplementary view doesn't appear, even though viewForSupplementaryElementOfKind gets called.

Gman9855 avatar Mar 25 '16 17:03 Gman9855

hi, need help. I custom UICollectionViewFlowLayout then viewForSupplementaryElementOfKind not called, how to solve ?

f474283547 avatar Oct 31 '16 09:10 f474283547

hi,'ve got a same problem. when i make a UICollectionViewFlowLayout's subclass,and registered that into collectionView.But the method "viewForSupplementaryElementOfKind" could not be called.Contrarily, i had done this like [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout],that method will be called. Could you get my mind and help me to solve it? Thanks

fiancrs avatar Nov 18 '16 03:11 fiancrs

of course, you can reference (https://github.com/lqcjdx/YLTagsChooser) and http://www.jianshu.com/p/2686f7066ee2#

------------------ 原始邮件 ------------------ 发件人: "fiancrs";[email protected]; 发送时间: 2016年11月18日(星期五) 中午11:18 收件人: "chiahsien/CHTCollectionViewWaterfallLayout"[email protected]; 抄送: "fanchongxi"[email protected]; "Comment"[email protected]; 主题: Re: [chiahsien/CHTCollectionViewWaterfallLayout]viewForSupplementaryElementOfKind and referenceSizeForFooterInSection notcalled? (#113)

hi,'ve got a same problem. when i make a UICollectionViewFlowLayout's subclass,and registered that into collectionView.But the method "viewForSupplementaryElementOfKind" could not be called.Contrarily, i had done this like [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout],that method will be called. Could you get my mind and help me to solve it? Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

f474283547 avatar Nov 18 '16 03:11 f474283547

@f474283547 不愧是自己人,效率可以,感谢

fiancrs avatar Nov 18 '16 03:11 fiancrs

哈哈 ,客气~

------------------ 原始邮件 ------------------ 发件人: "fiancrs";[email protected]; 发送时间: 2016年11月18日(星期五) 中午11:29 收件人: "chiahsien/CHTCollectionViewWaterfallLayout"[email protected]; 抄送: "fanchongxi"[email protected]; "Mention"[email protected]; 主题: Re: [chiahsien/CHTCollectionViewWaterfallLayout]viewForSupplementaryElementOfKind and referenceSizeForFooterInSection notcalled? (#113)

@f474283547 不愧是自己人,效率可以,感谢

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

f474283547 avatar Nov 18 '16 03:11 f474283547

Same issue, Has the problem been resolved?

AAChartModel avatar Sep 02 '22 06:09 AAChartModel