当我像这样设置单元格 imageView 阴影时:
[[[self imageView] layer] setShadowColor:[[UIColor redColor] CGColor]];
[[[self imageView] layer] setShadowOffset:CGSizeMake(1, 2)];
[[[self imageView] layer] setShadowOpacity:1.0];
[[[self imageView] layer] setShadowRadius:MASK_LAYER_RADIUS];
self.maskLayer = [[[CALayer alloc] init] autorelease];
[_maskLayer setFrame:CGRectMake(0, 0, [UIImage imageNamed:name].size.width, [UIImage imageNamed:name].size.height)];
[_maskLayer setBackgroundColor:[[UIColor grayColor] CGColor]];
[_maskLayer setCornerRadius:MASK_LAYER_RADIUS];
[_maskLayer setOpacity:MASK_LAYER_OPACITY];
[_maskLayer setShadowColor:[[UIColor greenColor] CGColor]];
[_maskLayer setShadowOffset:CGSizeMake(1, 2)];
[_maskLayer setShadowOpacity:1.0];
[_maskLayer setShadowRadius:MASK_LAYER_RADIUS];
[self.imageView.layer setMask:_maskLayer];
对不起,我无法上传效果图
当我跑步时,我发现 ShadowRadius 没有效果?我能看到角落
谢谢。