мне нужно добавить некоторое пространство в нижней части CollectionView, им пытается с некоторой сноской, это еще не работает,IOS добавить колонтитул в UICollectionView не работает
- (void)viewDidLoad
{
[super viewDidLoad];
[self initTestDataSource];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
[self.collectionView registerClass:[DOPCollectionViewCell class] forCellWithReuseIdentifier:@"DOPCollectionViewCell"];
[self.collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:UICollectionElementKindSectionFooter];
DOPCollectionViewLayout* customLayout = (DOPCollectionViewLayout*)self.collectionView.collectionViewLayout;
[self.collectionView setCollectionViewLayout:customLayout];
}
Я поставил точки останова в них, но не вызывается,
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
referenceSizeForFooterInSection:(NSInteger)section
{
NSLog(@"sizing footer");
return CGSizeMake(320,100);
}
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
UICollectionReusableView * view = nil;
return view;
NSLog(@"Something is happening with the footer...");
}
Мне просто нужно немного прозрачное пространство на нижней части представления коллекции,
это правильный способ сделать это ?, почему не работает? благодаря
Вы пытались использовать 'collectionView.contentInsets = UIEdgeInsetsMake (сверху, справа, внизу, влево);' вместо использования методов делегата выше нижнего колонтитула? – Zhang
безупречный! сделайте это ответом, чтобы я мог выбрать правильный! благодаря – MaKo