UIImageView is disappearing after CAKeyframeAnimation

泪湿孤枕 提交于 2019-11-30 07:38:55

Don't use those two lines. Instead actually set the transform on the layer. Replace these two lines:

animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;

with the final transform state:

[[self layer] setTransform:scale4];

When setting fill mode forwards and not removing the animation, it is causing the final state to be visual only. You need to actually change the layer's internal state for the property you're animating. To do so, override the animation for the transform property by using the transform name when adding the animation to the layer. This will cause the animation to use your animation instead of the default.

[[self layer] addAnimation:animation forKey:@"transform"];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!