Я пытаюсь добавить нижний колонтитул в UICollectionView.UICollectionView Footer
Ниже мой код,
UICollectionView добавляется через IB
В viewDidLoad зарегистрироваться колонтитула,
[mCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"footer"];
и реализован следующий метод
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
UICollectionReusableView *reusableview = nil;
if (kind == UICollectionElementKindSectionFooter) {
UICollectionReusableView *headerView = [mCollectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"footer" forIndexPath:indexPath];
[headerView addSubview:mFooterView];
reusableview = headerView;
}
return reusableview;
}
Но мои приложения продолжать сбой, а ниже - журнал,
*** отказ Assertion в - [UICollectionView _dequeueReusableViewOfKind: withIdentifier: forIndexPath:], /SourceCache/UIKit/UIKit-2380.17/UICollectionView.m:2249
Любая помощь приветствуется.
Спасибо.
Да, я сделал то же самое, и это сработало для меня !! Я отметит свой ответ, как правильно –