UIModalTransitionStyleFlipHorizo​​ntal在横向模式下垂直翻转

时间:2012-12-10 05:45:17

标签: iphone ios uinavigationcontroller screen-orientation uiviewanimationtransition

我正在以横向模式开发应用程序。在横向模式下执行UIModalTransitionStyleFlipHorizo​​ntal翻转时,它会垂直翻转。

有没有办法解决它?

以下是代码:

InfoViewController *vc = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:vc animated:YES];
[vc release];

2 个答案:

答案 0 :(得分:1)

MyViewController *viewController = [[MyViewController alloc] init];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:YES];
[self.navigationController pushViewController:viewController animated:NO];
[UIView commitAnimations];
[viewController release];

检查一下......

答案 1 :(得分:0)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}