美文网首页
9.5 AutoLayout约束的优先级

9.5 AutoLayout约束的优先级

作者: 草根小强 | 来源:发表于2019-04-25 16:58 被阅读0次

9.5 AutoLayout约束的优先级

#import "ViewController.h"

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIView *purpleView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    //点击空白 让紫色view消失
    [self.purpleView removeFromSuperview];
    
    [UIView animateWithDuration:2.0 animations:^{
       
        [self.view layoutIfNeeded];
    }];
}
@end
AutoLayout约束的优先级.png
AutoLayout约束的优先级2.png

相关文章

网友评论

      本文标题:9.5 AutoLayout约束的优先级

      本文链接:https://www.haomeiwen.com/subject/riizgqtx.html