我有橫向專用的應用程序。導航效果很好:當我推新視圖時,它會從左向右滑動並加載顯示。當它被卸載時,從右向左滑動。 但是,當我旋轉設備時,事情會改變,推動現在從右向左。 面對的iOS 7中的錯誤不處理舊樣式而不迴避怪懶出現的滑動意見推,我用這個代碼風景旋轉後推動方向改變
- (void)pushViewControllerRetro:(UIViewController *)viewController {
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
[self.view.layer addAnimation:transition forKey:nil];
[self pushViewController:viewController animated:NO];
}
- (void)popViewControllerRetro {
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromTop;
[self.view.layer addAnimation:transition forKey:nil];
[self popViewControllerAnimated:NO];
}
爲什麼?
你的意思是,如果你旋轉180度? –
是的,我的意思是 – giuseppe