EAFeatureItem.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // EAFeatureItem.h
  3. // EAFeatureGuide
  4. //
  5. // Created by zhiyun.huang on 4/27/16.
  6. // Copyright © 2016 EAH. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. //单布局元素在界面上垂直居中时,是将介绍文案布局顶部,还是底部
  10. typedef NS_ENUM(NSUInteger, EAFeatureItemAlignmentPriority) {
  11. EAFeatureItemAlignmentBottomFirst, //底部优先
  12. EAFeatureItemAlignmentTopFirst, //顶部优先
  13. };
  14. @interface EAFeatureItem : NSObject
  15. //需要高亮的UI元素,与focusRect二者直选其一,如果设置了focusView,focusRect无效
  16. @property (nonatomic, strong ,readonly) UIView *focusView;
  17. //需要高亮的区域
  18. @property (nonatomic, assign ,readonly) CGRect focusRect;
  19. //如果高亮元素需要添加圆角效果,需要设置相应的圆角半径
  20. @property (nonatomic, assign) CGFloat focusCornerRadius;
  21. //高亮区域相对于focusView的frame的偏移
  22. @property (nonatomic, assign) UIEdgeInsets focusInsets;
  23. //一段对该区域的文字介绍,也可以是一张本地图的名称,必须是png或者jpg图片
  24. @property (nonatomic, strong) NSString *introduce;
  25. //介绍的字体
  26. @property (nonatomic, strong) UIFont *introduceFont;
  27. //介绍文字的颜色
  28. @property (nonatomic, strong) UIColor *introduceTextColor;
  29. //单布局元素在界面上垂直居中时,是将介绍文案布局顶部,还是底部
  30. @property (nonatomic ,assign) EAFeatureItemAlignmentPriority introduceAlignmentPriority;
  31. //当action不为nil的时候,会在介绍的下方生成一个按钮,按钮的响应事件就是action
  32. @property (nonatomic, copy) void(^action)(id sender);
  33. //按钮的标题,默认是“知道了”,只有在action不为nil的才有效
  34. @property (nonatomic, copy) NSString *actionTitle;
  35. //指示符号的图片名称
  36. @property (nonatomic, copy) NSString *indicatorImageName;
  37. //生成的按钮的背景图片名称
  38. @property (nonatomic, copy) NSString *buttonBackgroundImageName;
  39. - (instancetype)initWithFocusView:(UIView *)focusView focusCornerRadius:(CGFloat) focusCornerRadius focusInsets:(UIEdgeInsets) focusInsets;
  40. - (instancetype)initWithFocusRect:(CGRect)rect focusCornerRadius:(CGFloat) focusCornerRadius focusInsets:(UIEdgeInsets) focusInsets;
  41. @end