Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CGImage オブジェクトの NSMutableArray があります。すべての画像のサイズは異なります (80x20 px、200x200 px、10x10 px など)。サイズが 256x256 の CALayer でこれらをアニメーション化しようとしています。アニメーションは機能しますが、私の CGImages は CALayer の寸法に引き伸ばされます。CGImages がスケーリングされないようにするにはどうすればよいですか?
ありがとうございました。
私自身の質問に答えるために。レイヤーの contentsGravity プロパティを kCAGravityCenter に設定する必要があり、それでうまくいきました。contentsGravity のデフォルト値は kCAGravityResize で、レイヤーの境界を埋めるために引き伸ばされます。