这是我的代码。
listView.layer.masksToBounds = NO;
listView.layer.shadowOffset = CGSizeMake(-3, 3);
listView.layer.shadowColor=[[UIColor blackColor] CGColor];
listView.layer.shadowRadius = 4;
listView.layer.shadowOpacity = 1.0;
[listView.layer setShouldRasterize:YES];
具有阴影效果时,它运行良好。
当更改
listView.layer.masksToBounds = YES;
我没有得到阴影效果。