【发布时间】:2014-09-12 02:22:12
【问题描述】:
所以,在我的旋转处理程序中,我正在为横向模式做一些布局。我想在旋转完成后执行一些额外的动画,所以我将持续时间增加到一个更大的值并开始一个关键帧类型的动画。
我发现由于某种原因我无法有效地增加持续时间。无论我将持续时间设置为什么,下面的代码似乎都在旋转的时间跨度(0.4 秒或其他任何时间)内运行。
旋转动画是否已经在进行中,导致无法启动较长的动画?
感谢您的帮助。
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval) duration
{
duration = 10.0; // overriding the duration to a longer value
// running some keyframed animation over the longer animation
[UIView animateKeyframesWithDuration: duration delay:0.0 options:UIViewKeyframeAnimationOptionBeginFromCurrentState
animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0
relativeDuration:total_duration_sec
animations:^{ /*do some stuff */ }];
}
【问题讨论】: