CSActionSheet.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // CSActionSheet.h
  3. // taishan
  4. //
  5. // Created by e3mo on 15/7/7.
  6. // Copyright (c) 2015年 times. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface CSActionSheet : UIView {
  10. UIView *show_view;
  11. UIButton *close_btn;
  12. UIButton *cancal_btn;
  13. BOOL isInAction;
  14. NSArray *titles_array;
  15. }
  16. @property (readwrite, copy) void (^close) (id sender);//结束hideView动画时
  17. @property (readwrite, copy) void (^action) (int index, id sender);//点击选项时
  18. /**
  19. iOS自带的UIActionSheet不能改变颜色,故写这个
  20. */
  21. /**
  22. 该控件会有一个黑色半透明的遮罩,点击遮罩选择框将执行hideView动画
  23. frame:决定遮罩的位置大小和选择框的宽度
  24. titles:选项文字数组
  25. cancal:取消按钮的文字
  26. normal_color:文字普通状态颜色
  27. highlighted_color:文字点击状态颜色,可为nil
  28. cellBgColor:选项框背景颜色
  29. cellLineColor:选择框分隔线颜色
  30. tips:提示文字,可换行,可为空,为空则隐藏模块
  31. tipsColor:提示文字颜色,可为空,为空则为默认颜色
  32. */
  33. - (id)initWithFrame:(CGRect)frame titles:(NSArray*)titles cancal:(NSString*)cancal normal_color:(UIColor*)normalColor highlighted_color:(UIColor*)color;
  34. - (id)initWithFrame:(CGRect)frame titles:(NSArray *)titles cancal:(NSString *)cancal normal_color:(UIColor *)normalColor highlighted_color:(UIColor *)color tips:(NSString*)tips tipsColor:(UIColor*)tipsColor;
  35. - (id)initWithFrame:(CGRect)frame titles:(NSArray *)titles cancal:(NSString *)cancal normal_color:(UIColor *)normalColor highlighted_color:(UIColor *)color tips:(NSString*)tips tipsColor:(UIColor*)tipsColor cellBgColor:(UIColor*)bgColor cellLineColor:(UIColor*)lineColor;
  36. - (void)setCancalLabelColor:(UIColor*)color highlightedColor:(UIColor*)highColor;//设置取消按钮的颜色,highColor可为空
  37. - (void)showView:(void (^) (int index, id sender))action close:(void (^) (id sender))close;//执行出现动画,初始化后需要执行
  38. - (void)hideView;//执行隐藏动画
  39. - (BOOL)viewIsInAction;//判断当前是否在动画过程中
  40. @end