具体实现步骤:在viewdidLoad中实现即可
//1.设置imageView
UIImage *image = [UIImage imageNamed:@"头像1"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
//2.设置imageView的layer的位置为控制器view的中心点
imageView.layer.position = self.view.center;
[self.view addSubview:imageView];
//3.设置边框
[imageView.layer setBorderWidth:2.0f];
//4.设置边框颜色
[imageView.layer setBorderColor:[UIColor blueColor].CGColor];
//5.设置圆角
[imageView.layer setCornerRadius:50];
//6.设置可裁剪为yes
[imageView.layer setMasksToBounds:YES];
//7.设置阴影
[imageView.layer setShadowOpacity:1.0f];
[imageView.layer setShadowOffset:CGSizeMake(10, 10)];
[imageView.layer setShadowColor:[UIColor blackColor].CGColor];