美文网首页iOS
collectionView调整cell内容边距

collectionView调整cell内容边距

作者: CYC666 | 来源:发表于2018-12-14 15:04 被阅读0次

组头组尾不受影响

#pragma mark - 调整内容的边距

-(UIEdgeInsets)collectionView:(UICollectionView*)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {

    if(section ==0) {

        returnUIEdgeInsetsMake(0,20,0,20);

    }elseif(section ==1) {

        returnUIEdgeInsetsMake(0,0,0,0);

    }else{

        returnUIEdgeInsetsMake(0,0,0,0);

    }

}

相关文章

网友评论

    本文标题:collectionView调整cell内容边距

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