私は現在のカスタムを作成してトランジションを終了し、いくつか問題があります。私がしたいことは、iOS 7でこの涼しい深いアニメーションを繰り返すことです(私たちがいくつかのアプリケーションを開いたり閉じたりするとき)。 私には第1コントローラと第2コントローラがあります。すべてのアニメーションはFirst Controller(UIViewControllerTransitioningDelegateおよびUIViewControllerAnimatedTransitioningをサポート)にあります。だから私はちょうどチェックしている:それが提示されている場合 - 私は1つのアニメーション(1番目と2番目のビューを拡大)、解雇されている場合 - 私は別のアニメーション(1番目と2番目のビューを縮小している)をやっている。現在のアニメーションは問題なく動作しますが、アニメーションを終了すると問題が発生します。何らかの理由で、私が2番目のコントローラー(UINavigationController)を縮小しているときに、その背後に黒い背景が表示されます(スケーリングが縮小されている間に最初のコントローラーを見たいので間違っています)。ファーストコントローラーのコードです。ios 7カスタムプレゼントとトランジションを外します
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
UIView *transitionView = [transitionContext containerView];
id toViewController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
id fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
BOOL isPresenting;
isPresenting = [toViewController isKindOfClass:[UINavigationController class]];
UINavigationController *navigator = isPresenting ? toViewController : fromViewController;
if (isPresenting) {
[transitionView addSubview:navigator.view];
navigator.view.transform = CGAffineTransformMakeScale(0.1, 0.1);
navigator.view.alpha = 0;
}
navigator.view.center = self.startButton.center;
void(^AnimationBlock)(void) =^{
if (isPresenting) {
navigator.view.transform = CGAffineTransformMakeScale(1, 1);
self.view.transform = CGAffineTransformMakeScale(4, 4);
navigator.view.alpha = 1;
self.startButton.alpha = 0;
} else {
navigator.view.transform = CGAffineTransformMakeScale(0.1, 0.1);
self.view.transform = CGAffineTransformMakeScale(1, 1);
navigator.view.alpha = 0;
self.startButton.alpha = 1;
}
};
[UIView animateWithDuration:1
delay:0.0f
usingSpringWithDamping:50.0
initialSpringVelocity:4
options:UIViewAnimationOptionLayoutSubviews
animations:^{
AnimationBlock();
} completion:^(BOOL finished) {
[transitionContext completeTransition:YES];
if (!isPresenting) {
[navigator.view removeFromSuperview];
}
}];
}
- (void)completeTransitionInContext:(id<UIViewControllerContextTransitioning>)transitionContext{
[transitionContext completeTransition:YES];
}
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext{
return 1;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source {
return self;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed {
return self;
}
いくつかのコードやスクリーンを追加する必要があるかどうか教えてください。 ありがとうございます!
iOS 7 APIは公の利用可能性(18 sept)までNDAの下にあります – Vinzzz
私は非常に似た問題があり、iOS7 APIはもはやNDAの下にありません...解決方法を教えてください。ありがとう! – veducm
まだ回答がわからない:( –