File tree Expand file tree Collapse file tree
examples/ASCollectionView/Sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 274274
275275@optional
276276
277+ - (ASDisplayNode *)collectionView : (ASCollectionView *)collectionView nodeForSupplementaryElementOfKind : (NSString *)kind atIndexPath : (NSIndexPath *)indexPath ;
278+
277279/* *
278280 * Provides the constrained size range for measuring the node at the index path.
279281 *
Original file line number Diff line number Diff line change @@ -76,6 +76,17 @@ - (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtI
7676 return node;
7777}
7878
79+ - (ASDisplayNode *)collectionView : (ASCollectionView *)collectionView nodeForSupplementaryElementOfKind : (NSString *)kind atIndexPath : (NSIndexPath *)indexPath
80+ {
81+ ASDisplayNode *node = [[ASDisplayNode alloc ] init ];
82+ if ([kind isEqualToString: UICollectionElementKindSectionHeader]) {
83+ node.backgroundColor = [UIColor blueColor ];
84+ } else {
85+ node.backgroundColor = [UIColor redColor ];
86+ }
87+ return node;
88+ }
89+
7990- (NSInteger )collectionView : (UICollectionView *)collectionView numberOfItemsInSection : (NSInteger )section
8091{
8192 return 300 ;
You can’t perform that action at this time.
0 commit comments