My problem is:

I have a CAShapeLayer named outCircle. I add some CATextLayers as sublayers of outCircle. The problem is that when I'm pinching outCircle and doing so scale it, the sublayer CATextLayers resize too (maybe obvious) and become blurry and not crisp. The text looks horrible!

So I want to keep the original size and (maybe) position of the text layers yet keeping them sublayers of outCircle.

  • Is it possible?
  • How can I do it?

One solution is to not make the CATextLayers sublayers of outCircle but for various reasons I need to do it. Thanks for your help in advice!

有帮助吗?

解决方案

try setting the inverse-scale value to textLayers. i.e if you set scale of .5 to shapeLayer, set (1/.5 =2) as scale to textLayers.

shapeLayer.affineTransform =CGAffineTransformMakeScale(.5, .5);
textLayer.affineTransform =CGAffineTransformMakeScale(2, 2);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top