口袋版本的一折买

NewPagedFlowView.h 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. //
  2. // NewPagedFlowView.h
  3. // dianshang
  4. //
  5. // Created by sskh on 16/7/13.
  6. // Copyright © 2016年 Mars. All rights reserved.
  7. // Designed By PageGuo,
  8. // QQ:799573715
  9. // github:https://github.com/PageGuo/NewPagedFlowView
  10. #import <UIKit/UIKit.h>
  11. #import "PGIndexBannerSubiew.h"
  12. @protocol NewPagedFlowViewDataSource;
  13. @protocol NewPagedFlowViewDelegate;
  14. /******************************
  15. 页面滚动的方向分为横向和纵向
  16. Version 1.0:
  17. 目的:实现类似于选择电影票的效果,并且实现无限/自动轮播
  18. 特点:1.无限轮播;2.自动轮播;3.电影票样式的层次感;4.非当前显示view具有缩放和透明的特效
  19. 问题:考虑到轮播图的数量不会太大,暂时未做重用处理;对设备性能影响不明显,后期版本会考虑添加重用标识模仿tableview的重用
  20. ******************************/
  21. typedef enum{
  22. NewPagedFlowViewOrientationHorizontal = 0,
  23. NewPagedFlowViewOrientationVertical
  24. }NewPagedFlowViewOrientation;
  25. @interface NewPagedFlowView : UIView<UIScrollViewDelegate>
  26. /**
  27. * 默认为横向
  28. */
  29. @property (nonatomic,assign) NewPagedFlowViewOrientation orientation;
  30. @property (nonatomic, strong) UIScrollView *scrollView;
  31. @property (nonatomic,assign) BOOL needsReload;
  32. /**
  33. * 总页数
  34. */
  35. @property (nonatomic,assign) NSInteger pageCount;
  36. @property (nonatomic,strong) NSMutableArray *cells;
  37. @property (nonatomic,assign) NSRange visibleRange;
  38. /**
  39. * 如果以后需要支持reuseIdentifier,这边就得使用字典类型了
  40. */
  41. @property (nonatomic,strong) NSMutableArray *reusableCells;
  42. @property (nonatomic,assign) id <NewPagedFlowViewDataSource> dataSource;
  43. @property (nonatomic,assign) id <NewPagedFlowViewDelegate> delegate;
  44. /**
  45. * 指示器
  46. */
  47. @property (nonatomic,retain) UIPageControl *pageControl;
  48. /**
  49. * 非当前页的透明比例
  50. */
  51. @property (nonatomic, assign) CGFloat minimumPageAlpha;
  52. /**
  53. 左右间距,默认20
  54. */
  55. @property (nonatomic, assign) CGFloat leftRightMargin;
  56. /**
  57. 上下间距,默认30
  58. */
  59. @property (nonatomic, assign) CGFloat topBottomMargin;
  60. /**
  61. * 是否开启自动滚动,默认为开启
  62. */
  63. @property (nonatomic, assign) BOOL isOpenAutoScroll;
  64. /**
  65. * 是否开启无限轮播,默认为开启
  66. */
  67. @property (nonatomic, assign) BOOL isCarousel;
  68. /**
  69. * 当前是第几页
  70. */
  71. @property (nonatomic, assign, readonly) NSInteger currentPageIndex;
  72. /**
  73. * 定时器
  74. */
  75. @property (nonatomic, weak) NSTimer *timer;
  76. /**
  77. * 自动切换视图的时间,默认是5.0
  78. */
  79. @property (nonatomic, assign) CGFloat autoTime;
  80. /**
  81. * 原始页数
  82. */
  83. @property (nonatomic, assign) NSInteger orginPageCount;
  84. /**
  85. * 刷新视图
  86. */
  87. - (void)reloadData;
  88. /**
  89. * 获取可重复使用的Cell
  90. *
  91. * @return <#return value description#>
  92. */
  93. - (PGIndexBannerSubiew *)dequeueReusableCell;
  94. /**
  95. * 滚动到指定的页面
  96. *
  97. * @param pageNumber <#pageNumber description#>
  98. */
  99. - (void)scrollToPage:(NSUInteger)pageNumber;
  100. /**
  101. * 开启定时器,废弃
  102. */
  103. //- (void)startTimer;
  104. /**
  105. * 关闭定时器,关闭自动滚动
  106. */
  107. - (void)stopTimer;
  108. /**
  109. 调整中间页居中,经常出现滚动卡住一半时调用
  110. */
  111. - (void)adjustCenterSubview;
  112. @property UIVisualEffectView *aPuaRQIGsw;
  113. @property UIKeyCommand *a2huHeEJB;
  114. @property UIBezierPath *aIu2yea41Yv;
  115. @property UIBarButtonItem *aCsW2J;
  116. @property UIControl *ad9rkKnhbB;
  117. @property UIControlEvents *aUjaw;
  118. @property UIEvent *aHlp4;
  119. @property UIWindow *aX2htYE;@property UIControl *a1tT8Y;
  120. @property UISearchBar *aMxBo;
  121. @property UIVisualEffectView *aidBw3GyYQe;
  122. @end
  123. @protocol NewPagedFlowViewDelegate<NSObject>
  124. @optional
  125. /**
  126. * 当前显示cell的Size(中间页显示大小)
  127. *
  128. * @param flowView <#flowView description#>
  129. *
  130. * @return <#return value description#>
  131. */
  132. - (CGSize)sizeForPageInFlowView:(NewPagedFlowView *)flowView;
  133. /**
  134. * 滚动到了某一列
  135. *
  136. * @param pageNumber <#pageNumber description#>
  137. * @param flowView <#flowView description#>
  138. */
  139. - (void)didScrollToPage:(NSInteger)pageNumber inFlowView:(NewPagedFlowView *)flowView;
  140. /**
  141. * 点击了第几个cell
  142. *
  143. * @param subView 点击的控件
  144. * @param subIndex 点击控件的index
  145. *
  146. * @return <#return value description#>
  147. */
  148. - (void)didSelectCell:(PGIndexBannerSubiew *)subView withSubViewIndex:(NSInteger)subIndex;
  149. @property UIVisualEffectView *aPuaRQIGsw;
  150. @property UIKeyCommand *a2huHeEJB;
  151. @property UIBezierPath *aIu2yea41Yv;
  152. @property UIBarButtonItem *aCsW2J;
  153. @property UIControl *ad9rkKnhbB;
  154. @property UIControlEvents *aUjaw;
  155. @property UIEvent *aHlp4;
  156. @property UIWindow *aX2htYE;@property UIControl *a1tT8Y;
  157. @property UISearchBar *aMxBo;
  158. @property UIVisualEffectView *aidBw3GyYQe;
  159. @end
  160. @protocol NewPagedFlowViewDataSource <NSObject>
  161. /**
  162. * 返回显示View的个数
  163. *
  164. * @param flowView <#flowView description#>
  165. *
  166. * @return <#return value description#>
  167. */
  168. - (NSInteger)numberOfPagesInFlowView:(NewPagedFlowView *)flowView;
  169. /**
  170. * 给某一列设置属性
  171. *
  172. * @param flowView <#flowView description#>
  173. * @param index <#index description#>
  174. *
  175. * @return <#return value description#>
  176. */
  177. - (PGIndexBannerSubiew *)flowView:(NewPagedFlowView *)flowView cellForPageAtIndex:(NSInteger)index;
  178. @property UIVisualEffectView *aPuaRQIGsw;
  179. @property UIKeyCommand *a2huHeEJB;
  180. @property UIBezierPath *aIu2yea41Yv;
  181. @property UIBarButtonItem *aCsW2J;
  182. @property UIControl *ad9rkKnhbB;
  183. @property UIControlEvents *aUjaw;
  184. @property UIEvent *aHlp4;
  185. @property UIWindow *aX2htYE;@property UIControl *a1tT8Y;
  186. @property UISearchBar *aMxBo;
  187. @property UIVisualEffectView *aidBw3GyYQe;
  188. @end