Frage

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!

Keine korrekte Lösung

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top