美文网首页
段尾的显示隐藏UICollectionReusableView

段尾的显示隐藏UICollectionReusableView

作者: 不慌不忙 | 来源:发表于2018-02-08 17:56 被阅读17次
点击每个cell后切换footer的显示隐藏

// 段尾高度     这一句话就ok

- (CGSize)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section{

    return  section==self.selectIndex?CGSizeMake(SCREEN_WIDTH,  SCREEN_WIDTH * 0.36):CGSizeMake(SCREEN_WIDTH,  0);

}

// selectIndex 当前选中索引

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {    

self.selectIndex = (int)indexPath.section;   

[self.collectionView reloadData];

}

相关文章

网友评论

      本文标题:段尾的显示隐藏UICollectionReusableView

      本文链接:https://www.haomeiwen.com/subject/pdgttftx.html