标签:
1. 打开开关
[logoImageView setTranslatesAutoresizingMaskIntoConstraints:NO];
2.开始布局
NSMutableArray *tmpConstraints = [NSMutableArray array];
[tmpConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-70-[logoImageView(==70)]" options:0 metrics:nil views:NSDictionaryOfVariableBindings(logoImageView)]];
[tmpConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"[logoImageView(==70)]" options:0 metrics:nil views:NSDictionaryOfVariableBindings(logoImageView)]];
[tmpConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"|-40-[forgetPasswordBtn]" options:0 metrics:nil views:NSDictionaryOfVariableBindings(forgetPasswordBtn)]];
[tmpConstraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[forgetPasswordBtn]-100-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(forgetPasswordBtn)]];
[self.view addConstraints:tmpConstraints];
标签:
原文地址:http://www.cnblogs.com/GJ-ios/p/5483248.html