什么是UICollectionView的supplementView或decorationView的索引路径?

eug*_*ene 8 iphone ios uicollectionview

indexpathUICollectionView的supplementView或decorationView意味着什么?

layoutAttributesForSupplementaryViewOfKind:atIndexPath: 
layoutAttributesForDecorationViewOfKind:atIndexPath:
Run Code Online (Sandbox Code Playgroud)

vit*_*ter 11

文档说:

由您决定如何使用indexPath参数来标识给定的补充视图.通常,您使用elementKind参数来标识补充视图的类型和indexPath信息,以区分该视图的不同实例.

装饰视图相同.

换句话说,对应于数据源中的位置的单元indexPath与对应于您想要的任何内容的补充或装饰视图的indexPath之间绝对没有相关性.