I am trying to make a circle UIImageView
, and it works. Below is the way I use to make it:
[self.pic.layer setMasksToBounds:YES];
[self.pic.layer setCornerRadius:50.0];
I would like to add some shadow to the UIImageView
. The below code does add some shadow to my image view, however, the image view changes back to square shape. Can someone give me some pointers to solve this problem? Below is the code I use to add the shadow:
self.pic.layer.shadowColor = [UIColor purpleColor].CGColor;
self.pic.layer.shadowOffset = CGSizeMake(0, 1);
self.pic.layer.shadowOpacity = 1;
self.pic.layer.shadowRadius = 1.0;
self.pic.clipsToBounds = NO;