有沒有人有任何想法,這不在iOS8自定義翻轉動畫,但在iOS7。UIViewController在iOS8中的自定義轉換
在iOS8中,我只看到沒有動畫的視圖,但是當視圖被解除時 我確實得到了自定義翻轉過渡。它就像它在呈現時忘記動畫一樣,但當它被解散時它會記住。
任何幫助將不勝感激它驅使我堅果。
- (void) animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext {
UIView *containerView = [transitionContext containerView];
UIViewController *fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
[containerView addSubview:fromVC.view];
UIViewController *toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
[containerView addSubview:toVC.view];
UIViewAnimationOptions animationOption = ([toVC.presentedViewController isEqual:fromVC])?UIViewAnimationOptionTransitionFlipFromLeft:UIViewAnimationOptionTransitionFlipFromRight;
if ([toVC class] == [ClockViewController class]) {
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
}
[UIView transitionFromView:fromVC.view
toView:toVC.view
duration:0.7f
options:animationOption
completion:^(BOOL finished){
[transitionContext completeTransition:YES];
}];
}