I have an NSMutableArray of CGImage objects. All the images have different dimensions ( 80×20 px, 200×200 px, 10×10 px, etc…)
I’m trying to animate these in CALayer which has 256×256 pixels size. The animation works, but my CGImages get stretched to the dimensions of the CALayer. How could I prevent my CGImages from getting scaled?
thank you.
To answer my own question. I had to set my layer’s contentsGravity property to kCAGravityCenter and that did the trick. The default value of contentsGravity is kCAGravityResize which makes things stretched to fill in layer’s bounds.