InfinitePagingView是UIView的子类。它包含一个无限可滚动的UIScrollView。
#import "InfinityPagingView.h"
...
- (void)loadView
{
[super loadView];
// create instance.
InfinitePagingView *pagingView = [[InfinitePagingView alloc] initWithFrame:CGRectMake(0.f, 30.f, 100.f, 50.f)];
// Adding each page views.(UIView based)
// (At least 3 pages.)
UIImageView *page1View = [[UIImageView alloc] initWithFrame:frame];
[pagingView addPageView:page1View];
...
[pagingView addPageView:page2View];
[pagingView addPageView:page3View];
[pagingView addPageView:page4View];
[pagingView addPageView:page5View];
[self.view addSubview:pagingView];
}
编译并运行项目文件。享受更多示例!
- (void)addPageView:(UIView *)pageView;
将视图添加到内部UIScrollView的子视图中。
- (void)scrollToPreviousPage;
滚动到上一页。
- (void)scrollToNextPage;
滚动到下一页。
- (void)pagingView:(InfinitePagingView *)pagingView willBeginDragging:(UIScrollView *)scrollView;
告诉代理分页视图何时开始滚动内容。
- (void)pagingView:(InfinitePagingView *)pagingView didScroll:(UIScrollView *)scrollView;
告诉代理当用户在接收器内部滚动内容视图时。
- (void)pagingView:(InfinitePagingView *)pagingView didEndDragging:(UIScrollView *)scrollView;
告诉代理在分页视图中拖拽结束。
- (void)pagingView:(InfinitePagingView *)pagingView willBeginDecelerating:(UIScrollView *)scrollView;
告诉代理分页视图开始减速滚动。
- (void)pagingView:(InfinitePagingView *)pagingView didEndDecelerating:(UIScrollView *)scrollView atPageIndex:(NSInteger)pageIndex;
告诉代理滚动视图已结束减速滚动。
MIT许可证。
有关更多信息,请参阅LICENSE.txt。