QuartzCore/QuartzCore.h

Simple way to round the corners of a UIImageView

Rounding the corners of an image in a UIImageView is simple

//You will need this import
#import QuartzCore/QuartzCore.h

imageView.layer.cornerRadius = 5.0;
imageView.layer.masksToBounds = YES;

//And to add a border:
imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
imageView.layer.borderWidth = 1.0;

Syndicate content