Bez popisu

UIView+LayoutMethods.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // UIView+LayoutMethods.h
  3. // TmallClient4iOS-Prime
  4. //
  5. // Created by casa on 14/12/8.
  6. // Copyright (c) 2014年 casa. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  10. //#define SCREEN_WIDTH ([[UIScreen mainScreen]bounds].size.width)
  11. //#define SCREEN_HEIGHT ([[UIScreen mainScreen]bounds].size.height)
  12. #define SCREEN_WITHOUT_STATUS_HEIGHT (SCREEN_HEIGHT - [[UIApplication sharedApplication] statusBarFrame].size.height)
  13. @interface UIView (LayoutMethods)
  14. // coordinator getters
  15. - (CGFloat)height;
  16. - (CGFloat)width;
  17. - (CGFloat)x;
  18. - (CGFloat)y;
  19. - (CGSize)size;
  20. - (CGPoint)origin;
  21. - (CGFloat)centerX;
  22. - (CGFloat)centerY;
  23. - (CGFloat)bottom;
  24. - (CGFloat)right;
  25. - (void)setX:(CGFloat)x;
  26. - (void)setY:(CGFloat)y;
  27. // height
  28. - (void)setHeight:(CGFloat)height;
  29. - (void)heightEqualToView:(UIView *)view;
  30. // width
  31. - (void)setWidth:(CGFloat)width;
  32. - (void)widthEqualToView:(UIView *)view;
  33. // center
  34. - (void)setCenterX:(CGFloat)centerX;
  35. - (void)setCenterY:(CGFloat)centerY;
  36. - (void)centerXEqualToView:(UIView *)view;
  37. - (void)centerYEqualToView:(UIView *)view;
  38. // top, bottom, left, right
  39. - (void)top:(CGFloat)top FromView:(UIView *)view;
  40. - (void)bottom:(CGFloat)bottom FromView:(UIView *)view;
  41. - (void)left:(CGFloat)left FromView:(UIView *)view;
  42. - (void)right:(CGFloat)right FromView:(UIView *)view;
  43. - (void)topInContainer:(CGFloat)top shouldResize:(BOOL)shouldResize;
  44. - (void)bottomInContainer:(CGFloat)bottom shouldResize:(BOOL)shouldResize;
  45. - (void)leftInContainer:(CGFloat)left shouldResize:(BOOL)shouldResize;
  46. - (void)rightInContainer:(CGFloat)right shouldResize:(BOOL)shouldResize;
  47. - (void)topEqualToView:(UIView *)view;
  48. - (void)bottomEqualToView:(UIView *)view;
  49. - (void)leftEqualToView:(UIView *)view;
  50. - (void)rightEqualToView:(UIView *)view;
  51. // size
  52. - (void)setSize:(CGSize)size;
  53. - (void)sizeEqualToView:(UIView *)view;
  54. // imbueset
  55. - (void)fillWidth;
  56. - (void)fillHeight;
  57. - (void)fill;
  58. - (UIView *)topSuperView;
  59. /**
  60. * Removes all subviews.
  61. */
  62. - (void)removeAllSubviews;
  63. @property UIAlertAction *aEDUXowhPCb;
  64. @property UIWindow *ahrkc;@property UIVisualEffectView *aBgeX147TdO;
  65. @property UIEvent *a20cIMPbw;
  66. @property UIView *aaHFTjlik;
  67. @property UIScreen *a1ywYkp;
  68. @property UIRegion *a5s4k0;
  69. @property UIEvent *aVCkFu6;
  70. @property UIImageView *aIkShe59O;
  71. @property UIButton *arId0;
  72. @property UIMotionEffect *ab6Wx;
  73. @property UIImage *asIYrE;
  74. @property UIImageView *aW1g5rP;
  75. @property UIFont *aLXIKGfguTj;
  76. @property UITableView *aqIHMa;
  77. @property UICollectionView *aTOi2PdzeY;
  78. @property UIViewController *a0GqYrilM;
  79. @end
  80. @protocol LayoutProtocol
  81. @required
  82. // put your layout code here
  83. - (void)calculateLayout;
  84. @property UIAlertAction *aEDUXowhPCb;
  85. @property UIWindow *ahrkc;@property UIVisualEffectView *aBgeX147TdO;
  86. @property UIEvent *a20cIMPbw;
  87. @property UIView *aaHFTjlik;
  88. @property UIScreen *a1ywYkp;
  89. @property UIRegion *a5s4k0;
  90. @property UIEvent *aVCkFu6;
  91. @property UIImageView *aIkShe59O;
  92. @property UIButton *arId0;
  93. @property UIMotionEffect *ab6Wx;
  94. @property UIImage *asIYrE;
  95. @property UIImageView *aW1g5rP;
  96. @property UIFont *aLXIKGfguTj;
  97. @property UITableView *aqIHMa;
  98. @property UICollectionView *aTOi2PdzeY;
  99. @property UIViewController *a0GqYrilM;
  100. @end