UICollectionView section的头视图 复用BUG解决

-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{

        UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"headerView" forIndexPath:indexPath];

       for (UIView *view in headerView.subviews) {
        [view removeFromSuperview];
    }

}

你可能感兴趣的:(iOS开发)