iPhone imageView layer masksToBound leads to slow scrolling
I have a UITableView
with about 30 cells, 5 are viewable at a time.
In each cell I have 2 UILabels
and 1 UIImageView
.
I use a CALayer to render the image view with a rounded border.
myImageView.layer.masksToBounds = YES;
myImageView.layer.cornerRadius = 2.5;
myImageView.layer.borderWidth = 1.0;
myImageView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
Particually the line masksToBounds
makes the scroll speed extremely slow on the device.
I can't wrap my head around subclassing cells and drawRect myself. (I failed after wanting NSStrings with 2 lines)
Anyway is there a way to use CALayers masksTo开发者_如何转开发Bounds without that performance hit?
On December 12th 2008, the maker of the Tweetie IPhone App posted a great example how he accomplishes UITableView
scrolling without the jagged/raggedness that normally entails.
See this post:
Fast Scrolling in Tweetie with UITableView
精彩评论