문제

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