I'm handling a pinch gesture, and I am scaling a UILabel
like this:
CGFloat factor = sender.scale;
view.transform = CGAffineTransformScale(view.transform, factor, factor);
The problem is when I zoom-in (make the label larger) it wont redraw itself, i.e. it becomes blurry. How do I make it sharp again?
The reason this happens is that transforms are applied to the rendered bitmap of the view's layer.
If you want to have the label's contents scaled adjust the contentsScale, too:
CGFloat scaleFactor = ...
view.layer.contentsScale = [UIScreen mainScreen].scale + scaleFactor;
view.transform = CGAffineTransformMakeScale( scaleFactor, scaleFactor );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With