I wanted the button to increase. Therefore, I scale the layer before starting the animation:
layer.transform = CATransform3DScale (layer.transform, 0.01, 0.01, 0.01); // some animation code
After the animation, I scaled it.
// some animation code CATransform3D endingScale = CATransform3DScale (layer.transform, 100, 100, 100); // some animation code [layer addAnimation:animation forKey:@"transform"]; layer.transform = endingScale;
It looks like if you directly assign it to a layer, the frame will change. However, using animation will not change the frame.
source share