Scale the size of CALayer contents

Registered User picture Registered User · Oct 16, 2011 · Viewed 22k times · Source

I have a few UIImageViews inside CALayer. How do I scale them all at once? I did try setting CALayer properties like la.contentsGravity = @"kCAGravityResizeAspect"; but the images inside the layer always display the original size.

Answer

vikingosegundo picture vikingosegundo · Oct 13, 2012

if layer contains the image, this will scale it to 65%

layer.transform = CATransform3DMakeScale(.65, .65, 1);