1
我已经添加阴影到一个UITableView(其覆盖屏幕sfrom的第三底部 - 见随附的屏幕截图),使用在一个UIView类别如下: CALayer的阴影而滚动的UITableView
- (void) addShadow {
UIBezierPath *path = [UIBezierPath bezierPathWithRect:self.bounds];
self.layer.masksToBounds = NO;
self.layer.shadowColor = [UIColor blackColor].CGColor;
self.layer.shadowOpacity = 1;
self.layer.shadowOffset = CGSizeMake(-5,-5);
self.layer.shadowRadius = 20;
self.layer.shadowPath = path.CGPath;
self.layer.shouldRasterize = YES;
}
它显示为预期,但是当我将它卷起来时,影子也卷起来了。此外,表格滚动超出其上界。你能提出这里有什么问题吗?如果我评论self.layer.masksToBounds = NO;
,阴影消失,但表滚动是预期的。因此,问题可能在于masksToBounds
左右。
它看起来像影子被应用于数百次的视图滚动 – CodaFi 2013-03-10 11:32:10