-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I want to set Headerview in BidirectionalCollectionViewLayout But I am not able to set headerview.
- (void)viewDidLoad
{
[super viewDidLoad];
[self.collectionView registerNib:[UINib nibWithNibName:@"DABrandListHeaderView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView"];
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
DABrandListHeaderView *reusableview = (DABrandListHeaderView *)[collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView" forIndexPath:indexPath];
[reusableview.titleLabel setText:[[self.itemsArray objectAtIndex:indexPath.section] valueForKey:@"section"]];
return reusableview;
}
return nil;
}
I have put this code but this code is not being called. Please help me so I can set header in collection view.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels