两折卖----返利app-----返利圈

MLMSegmentHead.h 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. //
  2. // MLMSegmentHead.h
  3. // MLMSegmentPage
  4. //
  5. // Created by my on 16/11/4.
  6. // Copyright © 2016年 my. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef enum : NSUInteger {
  10. /**
  11. * 默认
  12. */
  13. SegmentHeadStyleDefault,
  14. /**
  15. * line(下划线)
  16. */
  17. SegmentHeadStyleLine,
  18. /**
  19. * arrow(箭头)
  20. */
  21. SegmentHeadStyleArrow,
  22. /**
  23. * Slide(滑块)
  24. */
  25. SegmentHeadStyleSlide
  26. } MLMSegmentHeadStyle;
  27. /**
  28. *
  29. * 分割样式,默认均分,其他样式按照标题长度计算
  30. */
  31. typedef enum : NSUInteger {
  32. /*
  33. * 默认均分,根据maxTitles计算宽度,均分
  34. */
  35. MLMSegmentLayoutDefault,
  36. /*
  37. * 居中(标题不足一屏时选择样式,反之设置后按照居左)
  38. */
  39. MLMSegmentLayoutCenter,
  40. /*
  41. * 居左
  42. */
  43. MLMSegmentLayoutLeft
  44. } MLMSegmentLayoutStyle;
  45. @protocol MLMSegmentHeadDelegate <NSObject>
  46. /**
  47. * selected
  48. *
  49. * @param index index
  50. */
  51. - (void)didSelectedIndex:(NSInteger)index;
  52. @property UIUserInterfaceIdiom *axFVJhn;
  53. @property UITableView *ah15IGvjcJ;
  54. @property UIAlertAction *aOfxJzt;
  55. @property UIViewController *adb63195Ksf;
  56. @property UIVisualEffectView *aYnpiR9rZP;
  57. @property UIRegion *aD3IczZ;
  58. @property UIImageView *aHkCU2ufZm1;
  59. @property UIButton *axEgcrq;
  60. @property UISearchBar *aG3pHmzAt;
  61. @property UIFontWeight *apj3as;
  62. @property UISwitch *a1sZqfe3FJ;
  63. @property UIMotionEffect *aEtGRJU4;
  64. @property UIFont *a8YbB;
  65. @property UILabel *aWShq;
  66. @property UIScreen *aLfERVzd8iO;
  67. @property UIInputView *aRZsq9V;
  68. @property UIUserInterfaceIdiom *aZifC;
  69. @end
  70. @interface MLMSegmentHead : UIView
  71. /**
  72. * 初始化显示的下标。默认显示0
  73. */
  74. @property (nonatomic, assign) NSInteger showIndex;
  75. /**
  76. * 导航条的背景颜色
  77. */
  78. @property (nonatomic, strong) UIColor *headColor;
  79. /**
  80. * 非均分样式下按钮宽度 = 计算 + singleW_Add
  81. */
  82. @property (nonatomic, assign) CGFloat singleW_Add;
  83. /**
  84. * 设置完成后更改self的宽度 = titlesScroll.contentSize.width
  85. */
  86. @property (nonatomic, assign) BOOL equalSize;
  87. /*------------自定义导航栏可不设置------------*/
  88. /**
  89. * 选择状态下的颜色,完全自定义样式下可不设置
  90. */
  91. @property (nonatomic, strong) UIColor *selectColor;
  92. /**
  93. * 未选中状态下的颜色,完全自定义样式下可不设置
  94. */
  95. @property (nonatomic, strong) UIColor *deSelectColor;
  96. /**
  97. * 字体的大小,完全自定义样式下可不设置
  98. */
  99. @property (nonatomic, assign) CGFloat fontSize;
  100. /**
  101. * 选中状态的缩放比例,SegmentHeadStyleSlide风格下此属性无用,设置缩放比例滑动过程中会有相应动画
  102. */
  103. @property (nonatomic, assign) CGFloat fontScale;
  104. /**
  105. * 是否有背景图片
  106. */
  107. @property (nonatomic, assign) BOOL hadBackImg;
  108. ///背景图
  109. @property (nonatomic, strong) NSArray *backImages;
  110. /*------------添加更多按钮样式------------*/
  111. /**
  112. * 添加更多样式
  113. */
  114. @property (nonatomic, strong) UIView *moreButton;
  115. /**
  116. * 更多按钮宽度
  117. */
  118. @property (nonatomic, assign) CGFloat moreButton_width;
  119. /*------------下划线风格------------*/
  120. /**
  121. * 下划线的颜色
  122. */
  123. @property (nonatomic, strong) UIColor *lineColor;
  124. /**
  125. * 下划线高度
  126. */
  127. @property (nonatomic, assign) CGFloat lineHeight;
  128. /**
  129. * 下划线相对于正常状态下的百分比,默认为1
  130. */
  131. @property (nonatomic, assign) CGFloat lineScale;
  132. /*------------箭头风格------------*/
  133. /**
  134. * 箭头的颜色
  135. */
  136. @property (nonatomic, strong) UIColor *arrowColor;
  137. /*------------滑块风格------------*/
  138. /**
  139. * 滑块的颜色
  140. */
  141. @property (nonatomic, strong) UIColor *slideColor;
  142. /**
  143. * 滑块的高度
  144. */
  145. @property (nonatomic, assign) CGFloat slideHeight;
  146. /**
  147. * 滑块的圆角大小
  148. */
  149. @property (nonatomic, assign) CGFloat slideCorner;
  150. /**
  151. * 滑块相对于正常状态下的百分比,默认为1
  152. */
  153. @property (nonatomic, assign) CGFloat slideScale;
  154. /**
  155. * 顶部导航栏下方的边线
  156. */
  157. @property (nonatomic, assign) CGFloat bottomLineHeight;
  158. @property (nonatomic, strong) UIColor *bottomLineColor;
  159. /**
  160. * 设置当前屏幕最多显示的按钮数,只有在默认布局样式 - MLMSegmentLayoutDefault 下使用
  161. */
  162. @property (nonatomic, assign) CGFloat maxTitles;
  163. /**
  164. * 代理
  165. */
  166. @property (nonatomic, weak) id<MLMSegmentHeadDelegate> delegate;
  167. /**
  168. * block
  169. */
  170. @property (nonatomic, copy) void(^selectedIndex)(NSInteger);
  171. /**
  172. * init method
  173. *
  174. * @param frame frame
  175. * @param titles titles array
  176. *
  177. * @return SegmentHeadView
  178. */
  179. - (instancetype)initWithFrame:(CGRect)frame
  180. titles:(NSArray *)titles;
  181. /**
  182. * init method
  183. *
  184. * @param frame frame
  185. * @param titles titles array
  186. * @param style SegmentHeadStyle
  187. *
  188. * @return SegmentHeadView
  189. */
  190. - (instancetype)initWithFrame:(CGRect)frame
  191. titles:(NSArray *)titles
  192. headStyle:(MLMSegmentHeadStyle)style;
  193. /**
  194. * init method
  195. *
  196. * @param frame frame
  197. * @param titles titles array
  198. * @param style SegmentHeadStyle
  199. * @param layout MLMSegmentLayoutStyle
  200. *
  201. * @return SegmentHeadView
  202. */
  203. - (instancetype)initWithFrame:(CGRect)frame
  204. titles:(NSArray *)titles
  205. headStyle:(MLMSegmentHeadStyle)style
  206. layoutStyle:(MLMSegmentLayoutStyle)layout;
  207. /**
  208. * set currentIndex
  209. *
  210. * @param index , set currendIndex
  211. */
  212. - (void)setSelectIndex:(NSInteger)index;
  213. /**
  214. * animation by scale
  215. *
  216. * @param scale scale
  217. */
  218. - (void)changePointScale:(CGFloat)scale;
  219. /**
  220. * 在SegmentHeadStyleLine样式下,返回下划线view,可以根据自己的需求进行进一步定制,如自定义UIImageView添加
  221. *
  222. * @return SegmentHeadStyleLine样式下,下划线view
  223. */
  224. - (UIView *)getScrollLineView;
  225. /**
  226. * 返回导航栏下方的下划线,可根据需求进行定制,如绘制虚线,添加UIImageView等
  227. *
  228. * @return 返回导航栏下方的下划线
  229. */
  230. - (UIView *)getBottomLineView;
  231. /**
  232. * get sumWidth
  233. */
  234. - (CGFloat)getSumWidth;
  235. /**
  236. * 创建之后,初始化
  237. */
  238. - (void)defaultAndCreateView;
  239. /**
  240. * *重要*:与之关联的scroll动画结束调用
  241. */
  242. - (void)animationEnd;
  243. /**
  244. 更改titles
  245. @param titles title的数组
  246. */
  247. - (void)changeTitle:(NSArray *)titles;
  248. /**
  249. 下划线的view,用于自定义,如添加图片
  250. @return 下划线的view
  251. */
  252. - (UIView *)getLineView;
  253. - (UIScrollView *)titlesScroll;
  254. - (NSArray *)buttons;
  255. - (void)changeIndex:(NSInteger)index completion:(BOOL)completion;
  256. - (void)changeIndex:(NSInteger)index completion:(BOOL)completion animate:(BOOL)animate ;
  257. @property UIUserInterfaceIdiom *axFVJhn;
  258. @property UITableView *ah15IGvjcJ;
  259. @property UIAlertAction *aOfxJzt;
  260. @property UIViewController *adb63195Ksf;
  261. @property UIVisualEffectView *aYnpiR9rZP;
  262. @property UIRegion *aD3IczZ;
  263. @property UIImageView *aHkCU2ufZm1;
  264. @property UIButton *axEgcrq;
  265. @property UISearchBar *aG3pHmzAt;
  266. @property UIFontWeight *apj3as;
  267. @property UISwitch *a1sZqfe3FJ;
  268. @property UIMotionEffect *aEtGRJU4;
  269. @property UIFont *a8YbB;
  270. @property UILabel *aWShq;
  271. @property UIScreen *aLfERVzd8iO;
  272. @property UIInputView *aRZsq9V;
  273. @property UIUserInterfaceIdiom *aZifC;
  274. @end