Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is indexpath for UICollectionView's supplementaryView or decorationView?

What does indexpath mean for UICollectionView's supplementaryView or decorationView?

layoutAttributesForSupplementaryViewOfKind:atIndexPath: 
layoutAttributesForDecorationViewOfKind:atIndexPath:
like image 837
eugene Avatar asked Nov 07 '12 13:11

eugene


1 Answers

This Documentation says :

It is up to you to decide how to use the indexPath parameter to identify a given supplementary view. Typically, you use the elementKind parameter to identify the type of the supplementary view and the indexPath information to distinguish between different instances of that view.

Same for decoration views.

In other words there is absolutely no correlation between a cell indexPath which corresponds to a position in the data source, and the indexPath of the supplementary or decoration view which corresponds to whatever you want.

like image 171
vitaminwater Avatar answered Oct 23 '22 21:10

vitaminwater