// 段尾高度 这一句话就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];
}
网友评论