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