//把View設定成正圓形
[profileImageView.layer setCornerRadius:profileImageView.frame.size.width / 2];
[profileImageView.layer setMasksToBounds:YES];
//在View外面加上白框
CALayer *_viewLayer = profileImageView.layer;
UIColor *_borderColor = [UIColor whiteColor];
_viewLayer.borderColor = [_borderColor CGColor];
_viewLayer.borderWidth = 2.0f;
_viewLayer.shadowColor = [[UIColor grayColor] CGColor];
_viewLayer.shadowOffset = CGSizeMake(0, 2);
_viewLayer.shadowOpacity = 0.5;
_viewLayer.shadowRadius = 5.0f;
沒有留言:
張貼留言