// //给imageView添加阴影和边框
// UIImageView*imgvPhoto = [[UIImageView alloc] init];
//添加边框
CALayer *layer = [imageView layer];
layer.borderColor = [UIColor whiteColor].CGColor;
layer.borderWidth = 5.0f;
//添加四个边阴影
imageView.layer.shadowColor = [UIColor blackColor].CGColor;
imageView.layer.shadowOffset = CGSizeMake(0,0);
imageView.layer.shadowOpacity = 0.5;
imageView.layer.shadowRadius = 10.0;//给imageview添加阴影和边框
//添加两个边的阴影
imageView.layer.shadowColor = [UIColor blackColor].CGColor;
imageView.layer.shadowOffset = CGSizeMake(4,4);
imageView.layer.shadowOpacity = 0.5;
imageView.layer.shadowRadius=2.0;
imageView添加阴影和边框
最新推荐文章于 2022-10-27 16:11:56 发布
本文详细介绍了如何为UIImageView添加阴影和边框,包括设置边框颜色、宽度、四个边的阴影效果以及两个边的阴影效果。
1722

被折叠的 条评论
为什么被折叠?



