CSActionPicker.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // CSActionPicker.h
  3. // NotePad
  4. //
  5. // Created by e3mo on 16/8/5.
  6. // Copyright © 2016年 e3mo. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface CSActionPicker : UIView {
  10. UIView *show_view;
  11. UIButton *close_btn;
  12. BOOL isInAction;
  13. NSArray *titles_array;
  14. }
  15. @property (readwrite, copy) void (^close) (id sender);//结束hideView动画时
  16. @property (readwrite, copy) void (^action) (int index, id sender);//点击选项时
  17. /**
  18. 从上往下的文字选择框,无取消按钮,点击周围取消,一般用于Navigation下方,如果条目过多会会变为scrollview可滑动
  19. */
  20. /**
  21. 该控件会有一个黑色半透明的遮罩,点击遮罩选择框将执行hideView动画
  22. frame:决定遮罩的位置大小和选择框的宽度
  23. titles:选项文字数组
  24. normal_color:文字普通状态颜色
  25. highlighted_color:文字点击状态颜色,可为nil
  26. cellBgColor:选项框背景颜色
  27. cellLineColor:选择框分隔线颜色
  28. */
  29. - (id)initWithFrame:(CGRect)frame titles:(NSArray*)titles normal_color:(UIColor*)normalColor highlighted_color:(UIColor*)color;
  30. - (id)initWithFrame:(CGRect)frame titles:(NSArray *)titles normal_color:(UIColor *)normalColor highlighted_color:(UIColor *)color cellBgColor:(UIColor*)bgColor cellLineColor:(UIColor*)lineColor;
  31. - (void)showView:(void (^) (int index, id sender))action close:(void (^) (id sender))close;//执行出现动画,初始化后需要执行
  32. - (void)hideView;//执行隐藏动画
  33. - (BOOL)viewIsInAction;//判断当前是否在动画过程中
  34. @end