How can I add a header view / top view (not section header) at the top of a UICollectionView
?
It should act excactly as UITableView
's tableHeaderView
property.
So it needs to sit on top of the first section header view (before the section at index 0), scroll along with the rest of the content, and have user interaction.
The best I've come up with so far is to make a special XIB (with MyCollectionReusableView
subclass of UICollectionReusableView
as the File's owner) for the first section header view that is big enough to also contain my subviews in header, it's kind of a hack, I think, and I haven't managed to detect touches.
Not sure if I can make my MyCollectionReusableView
subclass to allow touches or there's a better way.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…