口袋优选

UIView+TYAutoLayout.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // UIView+TYAutoLayout.h
  3. // TYAlertControllerDemo
  4. //
  5. // Created by tanyang on 15/9/8.
  6. // Copyright (c) 2015年 tanyang. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UIView (TYAutoLayout)
  10. - (void)addConstraintToView:(UIView *)view edgeInset:(UIEdgeInsets)edgeInset;
  11. - (void)addConstraintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView
  12. bottomView:(UIView *)bottomView rightView:(UIView *)rightView edgeInset:(UIEdgeInsets)edgeInset;
  13. - (void)addConstraintWithLeftView:(UIView *)leftView toRightView:(UIView *)rightView constant:(CGFloat)constant;
  14. - (NSLayoutConstraint *)addConstraintWithTopView:(UIView *)topView toBottomView:(UIView *)bottomView constant:(CGFloat)constant;
  15. - (void)addConstraintWidth:(CGFloat)width height:(CGFloat)height;
  16. - (void)addConstraintEqualWithView:(UIView *)view widthToView:(UIView *)wView heightToView:(UIView *)hView;
  17. - (NSLayoutConstraint *)addConstraintCenterYToView:(UIView *)yView constant:(CGFloat)constant;
  18. - (void)addConstraintCenterXToView:(UIView *)xView centerYToView:(UIView *)yView;
  19. - (void)removeConstraintWithAttribte:(NSLayoutAttribute)attr;
  20. - (void)removeConstraintWithView:(UIView *)view attribute:(NSLayoutAttribute)attr;
  21. - (void)removeAllConstraints;
  22. @end