views:

249

answers:

0

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 masksToBounds without that performance hit?