Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created July 27, 2013 01:56
Show Gist options
  • Save jontelang/6093349 to your computer and use it in GitHub Desktop.
Save jontelang/6093349 to your computer and use it in GitHub Desktop.
asd
UIView *re = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
re.backgroundColor = [UIColor redColor];
re.layer.borderWidth = 2;
re.layer.borderColor = [UIColor greenColor].CGColor;
self.view = re;
[self.view setAutoresizesSubviews:YES];
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[re release];
//[self.view setAutoresizesSubviews:YES];
//[re setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
//[self.view addSubview:re];
NSLog(@"self.view %@",self.view);
UIView *re2 = [[UIView alloc] initWithFrame:CGRectMake(10,10,50,50)];
[re2 setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin];
re2.backgroundColor = [UIColor greenColor];
[self.view addSubview:re2];
UIView *re3 = [[UIView alloc] initWithFrame:CGRectMake(((UIView*)self.view).frame.size.width - 60,10,50,50)];
[re3 setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin];
re3.backgroundColor = [UIColor blueColor];
[self.view addSubview:re3];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment