给UIImageView添加阴影和边框
UIImageView *_iconView = [[UIImageView alloc] init];
//添加边框
CALayer *layer = [_iconView layer];
layer.borderColor = [[UIColor whiteColor] CGColor];
layer.borderWidth = 5.0f;
//添加四个边阴影
_iconView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
_iconView.layer.shadowOpacity = 0.5;
_iconView.layer.shadowRadius = 10.0;
_iconView.layer.shadowColor = [[UIColor redColor] CGColor];
//添加两个边阴影
_iconView.layer.shadowOffset = CGSizeMake(4.0f, 4.0f);
_iconView.layer.shadowOpacity = 0.5;
_iconView.layer.shadowRadius = 2.0;
_iconView.layer.shadowColor = [[UIColor redColor] CGColor];