Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not show header and footer together #179

Closed
cs-joao-souza opened this issue Jul 31, 2017 · 1 comment
Closed

Can not show header and footer together #179

cs-joao-souza opened this issue Jul 31, 2017 · 1 comment

Comments

@cs-joao-souza
Copy link

Header and Footer haven't been shown together and i have know ideia what is going on.

  self.collectionLayout = [[CHTCollectionViewWaterfallLayout alloc] init];
  self.collectionLayout.headerHeight = 50.0f;  
  self.collectionLayout.footerHeight = 120.0f;
  self.collectionLayout.minimumContentHeight = 170.f;
  self.collectionLayout.sectionInset = UIEdgeInsetsMake(0.0f, 21.0f, 10.0f, 21.0f);
  self.collectionLayout.columnCount = 2;
  self.collectionLayout.minimumColumnSpacing = 10.0f;
  self.collectionLayout.minimumInteritemSpacing = 10.0f;
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {

  UICollectionReusableView *reusableview = nil;

  if ([kind isEqualToString:CHTCollectionElementKindSectionHeader]) {
    ColumnistsSectionTitleView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:kColumnistsSectionTitleViewIdentifier forIndexPath:indexPath];
    [headerView setupWithTitle:@"Colunistas do dia"];
    reusableview = headerView;
  } else if ([kind isEqualToString:CHTCollectionElementKindSectionFooter]) {
    ColumnistsSectionFooterView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:kColumnistsSectionFooterViewIdentifier forIndexPath:indexPath];
    [footerView setup];
    [footerView.buttonSeeAll addTarget:self action:@selector(seeAllAction) forControlEvents:UIControlEventTouchUpInside];
    reusableview = footerView;
  }

  return reusableview;
}

I have resisted the both class only header or only footer is shown.

What do i need to do?

@chiahsien
Copy link
Owner

Should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants