UIView+Size.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // UIView+Size.h
  3. // 乐销
  4. //
  5. // Created by 隋林栋 on 2017/1/13.
  6. // Copyright © 2017年 ping. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIView (Size)
  10. //添加属性
  11. @property (nonatomic, assign) CGFloat topToUpView;//default 0,if view height is 0,topToUpView will not calculate
  12. @property (nonatomic, strong) UIColor *topToUpViewBGColor;
  13. @property (nonatomic, assign) CGFloat bottomToDownView;
  14. //组合
  15. @property (nonatomic,assign) STRUCT_XY leftCenterY;
  16. @property (nonatomic,assign) STRUCT_XY leftTop;
  17. @property (nonatomic,assign) STRUCT_XY leftBottom;
  18. @property (nonatomic,assign) STRUCT_XY centerXTop;
  19. @property (nonatomic,assign) STRUCT_XY centerXCenterY;
  20. @property (nonatomic,assign) STRUCT_XY centerXBottom;
  21. @property (nonatomic,assign) STRUCT_XY rightTop;
  22. @property (nonatomic,assign) STRUCT_XY rightCenterY;
  23. @property (nonatomic,assign) STRUCT_XY rightBottom;
  24. //宽高
  25. @property (nonatomic,assign) STRUCT_XY widthHeight;
  26. #pragma mark 获取高度
  27. + (CGFloat)fetchHeight:(id)model;
  28. + (CGFloat)fetchHeight:(id)model selectorName:(NSString *)strSelectorName;
  29. + (CGFloat)fetchHeight:(id)model par:(id)par className:(NSString *)strClassName selectorName:(NSString *)strSelectorName;
  30. + (CGFloat)fetchHeight:(id)model className:(NSString *)strClassName selectorName:(NSString *)strSelectorName;
  31. #pragma mark 判断是否显示在屏幕上
  32. - (BOOL)isShowInScreen;
  33. //将views 组合
  34. + (instancetype)initWithViews:(NSArray *)ary;
  35. // reset views 组合
  36. - (void)resetWithViews:(NSArray *)ary;
  37. //灰色背景
  38. + (instancetype)initGrayBgWithViews:(NSArray *)ary;
  39. @end