[英]resizing a UIImageView using Core Animation
I would like to increase the height of a UIImageView
with every animation frame using Core Animation. 我想使用Core Animation在每个动画帧中增加
UIImageView
的高度。 Is there any way to do this? 有什么办法吗?
I have done this using an NSTimer
. 我已经使用
NSTimer
做到了这一点。 I set the UIImageView
contentMode to scalingMode and then with each tick of the timer i was incrementing the height. 我将
UIImageView
contentMode设置为scalingMode,然后随着计时器的每次计时我都在增加高度。
Is there a cleaner, high level way of doing this using Core Animation? 是否有使用Core Animation进行此操作的更简洁,更高级的方法?
Thanks, Harikant Jammi 谢谢,Harikant Jammi
With Core Animation, you would generally pick a desired size, and a duration, and the system will figure out the keyframes to get you there. 使用Core Animation,通常会选择所需的大小和持续时间,然后系统会找出关键帧以使您到达那里。 You CAN enter a bunch of interim points, and a bunch of times, but you won't be able to get exactly to the set-each-frame-value-precisely point.
您可以输入一堆临时点,也可以输入很多次,但是您将无法精确地达到每个框架值的精确设置点。 The system will do it's best to make it smooth.
系统将尽力使其平滑。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.