iOS 3D卡片式轮播
效果:
:
参考UITableView的UITableViewDataSource和UITableViewDelegate两个方法实现;支持五险轮播,可以加载本地图片,也可以加载网络图片,可以根据自己的需求自定义
Demo地址
UITableViewDelegate
1 | /** |
2 | * 当前显示cell的Size(中间页显示大小) |
3 | * |
4 | * @param flowView <#flowView description#> |
5 | * |
6 | * @return <#return value description#> |
7 | */ |
8 | – (CGSize)sizeForPageInFlowView:(HQFlowView *)flowView; |
9 | |
10 | /** |
11 | * 滚动到了某一列 |
12 | * |
13 | * @param pageNumber <#pageNumber description#> |
14 | * @param flowView <#flowView description#> |
15 | */ |
16 | – (void)didScrollToPage:(NSInteger)pageNumber inFlowView:(HQFlowView *)flowView; |
17 | |
18 | /** |
19 | * 点击了第几个cell |
20 | * |
21 | * @param subView 点击的控件 |
22 | * @param subIndex 点击控件的index |
23 | * |
24 | * @return <#return value description#> |
25 | */ |
26 | – (void)didSelectCell:(HQIndexBannerSubview *)subView withSubViewIndex:(NSInteger)subIndex;
|
UITableViewDataSource
1 | /** | |
2 | * 返回显示View的个数 | |
3 | * | |
4 | * @param flowView <#flowView description#> | |
5 | * | |
6 | * @return <#return value description#> | |
7 | */ | |
8 | – (NSInteger)numberOfPagesInFlowView:(HQFlowView *)flowView; | |
9 | ||
10 | /** | |
11 | * 给某一列设置属性 | |
12 | * | |
13 | * @param flowView <#flowView description#> | |
14 | * @param index <#index description#> | |
15 | * | |
16 | * @return <#return value description#> | |
17 | */ | |
18 | – (HQIndexBannerSubview *)flowView:(HQFlowView *)flowView cellForPageAtIndex:(NSInteger)index; |