Collection view Flow布局有执行分页的概念吗?
Collection view Flow layout have perform paging concept?
我已经集成了水平和垂直的集合视图流布局,但现在我想在 it.I 上执行分页概念想知道我可以动态地执行此操作吗?
检查 isPagingEnabled = true
您的 collection 视图。
代码风格注意事项:确保正确驼峰式命名您的变量。
1.Install 项目中的 pod 文件。
pod 'CCBottomRefreshControl'
- 将此文件导入到您要使用分页的 VC 中。
CCBottomRefreshControl/UIScrollView+BottomRefreshControl.h
使用下面的代码添加分页。
-(void)bottomRefreshEnable{
UIRefreshControl *refreshControl;
refreshControl = [UIRefreshControl new];
refreshControl.triggerVerticalOffset = 70;
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
self.customScrollView.bottomRefreshControl = refreshControl;
}
检测到滚动偏移量时将调用的最后一个方法(我们在上面的代码中保留了 70)。
- (void)handleRefresh:(UIRefreshControl *)refreshControl {
}
我已经集成了水平和垂直的集合视图流布局,但现在我想在 it.I 上执行分页概念想知道我可以动态地执行此操作吗?
检查 isPagingEnabled = true
您的 collection 视图。
代码风格注意事项:确保正确驼峰式命名您的变量。
1.Install 项目中的 pod 文件。
pod 'CCBottomRefreshControl'
- 将此文件导入到您要使用分页的 VC 中。
CCBottomRefreshControl/UIScrollView+BottomRefreshControl.h
使用下面的代码添加分页。
-(void)bottomRefreshEnable{ UIRefreshControl *refreshControl; refreshControl = [UIRefreshControl new]; refreshControl.triggerVerticalOffset = 70; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; self.customScrollView.bottomRefreshControl = refreshControl; }
检测到滚动偏移量时将调用的最后一个方法(我们在上面的代码中保留了 70)。
- (void)handleRefresh:(UIRefreshControl *)refreshControl { }