Skip to content

Instantly share code, notes, and snippets.

@arkilis
Created January 30, 2016 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkilis/9f9889fb03e890146b2a to your computer and use it in GitHub Desktop.
Save arkilis/9f9889fb03e890146b2a to your computer and use it in GitHub Desktop.
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *sv= self.view;
UIView *view1= [[UIView alloc] init];
[sv addSubview:view1];
view1.backgroundColor= [UIColor colorWithRed:0 green:0 blue:0 alpha:1.0];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@([[UIApplication sharedApplication] statusBarFrame].size.height));
make.left.equalTo(sv).with.offset(20);
make.right.equalTo(sv).with.offset(-20);
make.height.equalTo(sv.mas_height).with.multipliedBy(0.5);
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment