indexpath
UICollectionViewのsupplementaryViewまたはdecorationViewはどういう意味ですか?
layoutAttributesForSupplementaryViewOfKind:atIndexPath:
layoutAttributesForDecorationViewOfKind:atIndexPath:
indexpath
UICollectionViewのsupplementaryViewまたはdecorationViewはどういう意味ですか?
layoutAttributesForSupplementaryViewOfKind:atIndexPath:
layoutAttributesForDecorationViewOfKind:atIndexPath:
このドキュメントには次のように書かれています:
特定の補足ビューを識別するために indexPath パラメーターを使用する方法を決定するのは、ユーザー次第です。通常、elementKind パラメータを使用して補足ビューのタイプを識別し、indexPath 情報を使用してそのビューの異なるインスタンスを区別します。
装飾ビューについても同じです。
言い換えれば、データソース内の位置に対応するセルの indexPath と、必要なものに対応する補足ビューまたは装飾ビューの indexPath との間に相関関係はまったくありません。