我正在尝试制作一个圆形的 UIImageView
,并且它成功了。以下是我使用的方法:
[self.pic.layer setMasksToBounds:YES];
[self.pic.layer setCornerRadius:50.0];
我想给UIImageView
添加一些阴影。下面的代码确实给我的图像视图添加了一些阴影,但是图像视图会变回正方形。有人可以给我一些指点来解决这个问题吗?以下是我用来添加阴影的代码:
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;