Skip to content

Instantly share code, notes, and snippets.

@mikeplate
Created November 17, 2010 11:49
Show Gist options
  • Save mikeplate/703307 to your computer and use it in GitHub Desktop.
Save mikeplate/703307 to your computer and use it in GitHub Desktop.
Set rounded rect for all subviews and background color for buttons, iOS
#import <QuartzCore/QuartzCore.h>
- (void)viewDidLoad {
[super viewDidLoad];
for (UIView *subview in [self.view subviews]) {
subview.layer.cornerRadius = 10;
if ([subview isKindOfClass:UIButton.class])
[subview setBackgroundColor:[UIColor colorWithRed:0.33 green:0.33 blue:0.9 alpha:1.0]];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment