I have a UITableView
that has three UIImageView
per cell, while three cells are displayed on the screen (a total of nine UIImageView
views). Think of it like a bookshelf. Sometimes I can have as many as 500 books.
I added a shadow to the UIImageView
with this code:
UIImageView *itemImageView = [[UIImageView alloc] initWithFrame:CGRectMake(25, 7, 65, 75)]; itemImageView.contentMode = UIViewContentModeScaleAspectFit; itemImageView.tag = 6; itemImageView.layer.shadowColor = [UIColor blackColor].CGColor; itemImageView.layer.shadowOffset = CGSizeMake(3, -1); itemImageView.layer.shadowOpacity = 0.7; itemImageView.layer.shadowRadius = 3.0; itemImageView.clipsToBounds = NO; [cell.contentView addSubview:itemImageView];
When I add the shadow code, as seen above, the scroll performance is just completely killed and becomes volatile. Each image has a different Rect
, so a shadow should be created for each element when it scrolls. Anyone have any tips on adding shadows to my images on a UITableView
without this problem?
source share