美文网首页iOS进阶
UICollectionView设置header悬浮效果

UICollectionView设置header悬浮效果

作者: SunshineBrother | 来源:发表于2020-02-24 13:56 被阅读0次

    在iOS9.0后UICollectionView的头部视图也能像tableView的header一样出现悬浮挂住的效果。

    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        //header
        flowLayout.sectionHeadersPinToVisibleBounds = YES;
        //footer
        flowLayout.sectionFootersPinToVisibleBounds = YES;
    

    相关文章

      网友评论

        本文标题:UICollectionView设置header悬浮效果

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