美文网首页iOS 日常开发随笔Swift开发
自定义瀑布流(可添加自定义header和footer)

自定义瀑布流(可添加自定义header和footer)

作者: 阿狸先森丶12138 | 来源:发表于2017-09-07 17:34 被阅读44次

    github 地址github.com/Wanghongchao12138/CustomerCollectionView

    /* 设置cell 的宽高 */

    (CGFloat)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout heightForWidth:(CGFloat)width atIndexPath:(NSIndexPath*)indexPath;

    /* 设置collection 的头视图的size */

    (CGSize)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;

    /* 设置collection footer 视图的size */

    (CGSize)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;

    -- colCount --   设置CollectionView 的cell 的列数   -- sectionInset --    设置cell 的间距

    相关文章

      网友评论

        本文标题:自定义瀑布流(可添加自定义header和footer)

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