Skip to content

Instantly share code, notes, and snippets.

@arkilis
Last active January 30, 2016 07:48
Show Gist options
  • Save arkilis/96faa6e5cceeeebed663 to your computer and use it in GitHub Desktop.
Save arkilis/96faa6e5cceeeebed663 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(self.mas_topLayoutGuide);
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