Reputation: 1780
I have UITable with cell:
when I scroll in the table I fell slow and fragmentation when table reload
when I remove the shadow code, the slow and fragmentation gone. but I need the shadow.
self.layer.shadowOffset = CGSizeMake(-1,1);
self.layer.shadowRadius = 2;
self.layer.shadowColor = [[UIColor blackColor] CGColor];
self.layer.shadowOpacity = 0.5;
Upvotes: 0
Views: 28
Reputation: 933
Try to set shadowPath
on layer property. Specifying an explicit path usually improves rendering performance.
self.layer.shadowOffset = CGSizeMake(-1,1);
self.layer.shadowRadius = 2;
self.layer.shadowColor = [[UIColor blackColor] CGColor];
self.layer.shadowOpacity = 0.5;
self.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:10].CGPath;
Using self.bounds
as a path rect, make sure that view's frame is already set.
Upvotes: 1