将 DRPageScrollView 文件夹下的所有文件拖入您的项目中。
启用页面复用性非常简单
pageScrollView.pageReuseEnabled = YES;
注意:在向页面滚动视图添加任何页面之前,应设置 pageReuseEnabled
为所需值。
在子视图上使用 Auto Layout 不是必需的,但强烈建议。
出于简洁考虑,以下示例不包括 Auto Layout 代码。
[pageScrollView addPageWithHandler:^(UIView *pageView) {
UIView *squareView = [UIView new];
squareView.backgroundColor = [UIColor redColor];
squareView.frame = CGRectMake(50, 50, 100, 100);
[pageView addSubview:squareView];
}];
DRPageScrollView
可在 MIT 许可下使用。