iOS UICollectionView 水平分页滑动~ 封装demo

 联系人:石虎 QQ:1224614774  昵称: 嗡嘛呢叭咪哄

                     QQ群:807236138  群称: iOS 技术交流学习群

                     QQ群:713799633   群称:iOS技术交流学习群-2

一、概念

在外界直接一行代码实现

/** 设置行列间距及collectionView的内边距 */
- (void)sh_ColumnSpacing:(CGFloat)columnSpacing rowSpacing:(CGFloat)rowSpacing edgeInsets:(UIEdgeInsets)edgeInsets;
/** 设置多少行及每行展示的item个数 */
- (void)sh_RowCount:(NSInteger)rowCount itemCountPerRow:(NSInteger)itemCountPerRow;

#pragma mark - 构造方法
/** 设置多少行及每行展示的item个数 */
+ (instancetype)sh_horizontalPageFlowlayoutWithRowCount:(NSInteger)rowCount itemCountPerRow:(NSInteger)itemCountPerRow;
/** 设置多少行及每行展示的item个数 */
- (instancetype)initWithRowCount:(NSInteger)rowCount itemCountPerRow:(NSInteger)itemCountPerRow;

二、demo 效果图

下载 demo

码云:https://gitee.com/ShiHu132/SH_HorizontalPageView

1.一行水平滑动图:

2.二行水平滑动图:

3.三行水平滑动图:

4.四行水平滑动图:

5.五行水平滑动图:

三、 仿界面实现截图

谢谢!!!

本账号主要分享我成长过程中的各种心得感悟,包括技术总结, iOS、Swift 和 Mac 相关技术文章、工具资源、参与技术讨论,整理开发技巧、让学习成为一种享受!

猜你喜欢

转载自blog.csdn.net/shihuboke/article/details/103515139