Question

I've noticed that when you set the shadowpath on UIImageView's layer property, it kills the image quality. Can someone tell me why that happens and what the correct way of doing it is?

    imageView.layer.shouldRasterize = YES;
    imageView.layer.shadowPath = [UIBezierPath bezierPathWithRect:imageView.bounds].CGPath;

Update

It was the rasterization scale. You need to set that to your screen's scale. Else it uses the non retina image when creating the bitmap!

No correct solution

OTHER TIPS

When you set should rasterize on a layer to yes it causes the layer to draw out its contents into a bitmap. Thats why the image becomes somewhat blurry.

If you omit the first line the graphic quality won't change, but if you have a lot of content it will hurt performance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top