CrazyDev CrazyDev - 11 months ago 49
Objective-C Question

IOS: create a UIImage or UIImageView with rounded corners

Is it possible create an

or an
with rounded corners? Because I want take an
and show it inside an
, but I don't know how to do it.

Answer Source

Yes, it is possible.
Import the QuartzCore (#import <QuartzCore/QuartzCore.h>) header and play with the layer property of the UIImageView.

yourImageView.layer.cornerRadius = yourRadius;
yourImageView.clipsToBounds = YES;

See the CALayer class reference for more info.