UIImageView添加阴影和边框

来源:互联网 发布:经营业绩怎么写数据 编辑:程序博客网 时间:2024/05/22 08:00

//给imageview添加阴影和边框   

UIImageView imgvPhoto [UIImageView alloc] init];   

//添加边框   

CALayer layer [_imgvPhoto layer];   

layer.borderColor [[UIColor whiteColor] CGColor];   

layer.borderWidth 5.0f;   

//添加四个边阴影   

_imgvPhoto.layer.shadowColor [UIColor blackColor].CGColor;   

_imgvPhoto.layer.shadowOffset CGSizeMake(00);   

_imgvPhoto.layer.shadowOpacity 0.5;   

_imgvPhoto.layer.shadowRadius 10.0;给iamgeview添加阴影 wbr 和边框   

//添加两个边阴影   

_imgvPhoto.layer.shadowColor [UIColor blackColor].CGColor;   

_imgvPhoto.layer.shadowOffset CGSizeMake(44);   

_imgvPhoto.layer.shadowOpacity 0.5;   

_imgvPhoto.layer.shadowRadius 2.0 

0 0
原创粉丝点击