YCXMenu.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // YCXMenu.h
  3. // YCXMenuDemo_ObjC
  4. //
  5. // Created by 牛萌 on 15/5/6.
  6. // Copyright (c) 2015年 NiuMeng. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "YCXMenuItem.h"
  10. // Menu将要显示的通知
  11. extern NSString * const YCXMenuWillAppearNotification;
  12. // Menu已经显示的通知
  13. extern NSString * const YCXMenuDidAppearNotification;
  14. // Menu将要隐藏的通知
  15. extern NSString * const YCXMenuWillDisappearNotification;
  16. // Menu已经隐藏的通知
  17. extern NSString * const YCXMenuDidDisappearNotification;
  18. typedef void(^YCXMenuSelectedItem)(NSInteger index, YCXMenuItem *item);
  19. typedef enum {
  20. YCXMenuBackgrounColorEffectSolid = 0, //!<背景显示效果.纯色
  21. YCXMenuBackgrounColorEffectGradient = 1, //!<背景显示效果.渐变叠加
  22. } YCXMenuBackgrounColorEffect;
  23. @interface YCXMenu : NSObject
  24. + (void)showMenuInView:(UIView *)view fromRect:(CGRect)rect menuItems:(NSArray *)menuItems selected:(YCXMenuSelectedItem)selectedItem;
  25. + (void)showMenuInView:(UIView *)view fromRect:(CGRect)rect menuItems:(NSArray *)menuItems itemWidth:(CGFloat)width selected:(YCXMenuSelectedItem)selectedItem;
  26. + (void)dismissMenu;
  27. + (BOOL)isShow;
  28. // 主题色
  29. + (UIColor *)tintColor;
  30. + (void)setTintColor:(UIColor *)tintColor;
  31. // 圆角
  32. + (CGFloat)cornerRadius;
  33. + (void)setCornerRadius:(CGFloat)cornerRadius;
  34. // 箭头尺寸
  35. + (CGFloat)arrowSize;
  36. + (void)setArrowSize:(CGFloat)arrowSize;
  37. // 标题字体
  38. + (UIFont *)titleFont;
  39. + (void)setTitleFont:(UIFont *)titleFont;
  40. // 背景效果
  41. + (YCXMenuBackgrounColorEffect)backgrounColorEffect;
  42. + (void)setBackgrounColorEffect:(YCXMenuBackgrounColorEffect)effect;
  43. // 是否显示阴影
  44. + (BOOL)hasShadow;
  45. + (void)setHasShadow:(BOOL)flag;
  46. // 选中颜色
  47. + (UIColor*)selectedColor;
  48. + (void)setSelectedColor:(UIColor*)selectedColor;
  49. // 分割线颜色
  50. + (UIColor*)separatorColor;
  51. + (void)setSeparatorColor:(UIColor*)separatorColor;
  52. /// 菜单元素垂直方向上的边距值
  53. + (CGFloat)menuItemMarginY;
  54. + (void)setMenuItemMarginY:(CGFloat)menuItemMarginY;
  55. @end