UIImageView实现阴影处理
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 50, 50)];;
imageView.backgroundColor = [UIColor whiteColor];
//添加边框
CALayer * layer = [imageView layer];
layer.borderColor = [[UIColor yellowColor] CGColor];
layer.borderWidth = 5.0f;
//添加四个边阴影
imageView.layer.shadowColor = [UIColor redColor].CGColor;
imageView.layer.shadowOffset = CGSizeMake(0, 0);
imageView.layer.shadowOpacity = 0.5;
imageView.layer.shadowRadius = 3;
//添加两个边阴影
imageView.layer.shadowColor = [UIColor redColor].CGColor;
imageView.layer.shadowOffset = CGSizeMake(10, 1);
imageView.layer.shadowOpacity = 0.5;
imageView.layer.shadowRadius = 2.0;
[self.view addSubview:imageView];