Skip to content

Instantly share code, notes, and snippets.

@samjarman
Created January 9, 2014 20:33
Show Gist options
  • Save samjarman/8341490 to your computer and use it in GitHub Desktop.
Save samjarman/8341490 to your computer and use it in GitHub Desktop.
Rounding corners on UIViews (and their subclasses, UIImageView, etc)
UIImageView * roundedView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"wood.jpg"]];
// Get the Layer of any view
CALayer * l = [roundedView layer];
[l setMasksToBounds:YES];
[l setCornerRadius:10.0];
@samjarman
Copy link
Author

Thanks Sam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment