UICollectionViewFlowLayoutでのみ補足ビューをリロードする簡単な方法はありますか? 全体をリロードしたくありません。そうすることは可能ですか?
			
			19701 次
		
2 に答える
            27        
        
		
ドキュメントを確認した後、個々の補足ビューをリロードするかどうかreloadSections:はわかりませんが、UICollectionView の 1 つ以上のセクションを更新するために使用できます。(ドキュメント) したがって、セクション ヘッダーを更新する必要がある場合は、次のように呼び出すことができます。
目的 C:
[self.collectionView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 3)]];
迅速:
self.collectionView?.reloadSections(IndexSet(0 ..< 3))
たまたま呼び出すのは:
- (UICollectionReusableView *)collectionView: (UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
       //Place logic for handling update here...
}
于 2013-01-12T05:01:37.747   に答える