Kyle Rosenbluth
Kyle Rosenbluth

Reputation: 1682

UICollectionView with 2 sets of section headerViews

Is it possible to create a UICollectionView with 2 different sets of headers? For example, I want there to be one header that scrolls with the table and then stops at the top of the table, that floats normally like a tableView's section header. But then I also want "sub" headers, that scroll with the table and then stop at the bottom of the outer header, and switch to the next one and so forth. There will be many "sub" headers, but only one header. I tried to do this with a tableView, but it got very messy and was wondering if there was a cleaner way to create this using a UICollectionView. Any tips?

Thanks,

Upvotes: 1

Views: 104

Answers (1)

enjayem
enjayem

Reputation: 951

Yes, it's possible. I'd recommend starting with this.

You'll want to modify layoutAttributesForElementsInRect: to check the section number and return different behavior depending on whether or not section == 0.

Upvotes: 2

Related Questions