1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| - (void)viewDidLoad { [super viewDidLoad]; self.sections = @[ @{ @"header" : @"First Witch", @"content" : @"Hey, when will the three of us meet up later?" }, @{ @"header" : @"Second Witch", @"content" : @"When everything's straightened out." }, @{ @"header" : @"Third Witch", @"content" : @"That'll be just before sunset." }, @{ @"header" : @"First Witch", @"content" : @"Where?" }, @{ @"header" : @"Second Witch", @"content" : @"The dirt patch." }, @{ @"header" : @"Third Witch", @"content" : @"I guess we'll see Mac there." }, ];
[self.collectionView registerClass:[BIDContentCell class] forCellWithReuseIdentifier:@"CONTENT"];
self.collectionView.backgroundColor = [UIColor whiteColor];
UIEdgeInsets contentInset = self.collectionView.contentInset; contentInset.top = 20; [self.collectionView setContentInset:contentInset];
UICollectionViewLayout *layout = self.collectionView.collectionViewLayout; UICollectionViewFlowLayout *flow = (UICollectionViewFlowLayout *)layout; flow.sectionInset = UIEdgeInsetsMake(10, 20, 30, 20);
[self.collectionView registerClass:[BIDHeaderCell class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HEADER"];
flow.headerReferenceSize = CGSizeMake(100, 25); }
|