3

我正在開發橫向模式下的應用程序。在UIModalTransitionStyleFlipHorizo​​ntal在橫向模式下翻轉時,會垂直翻轉。UIModalTransitionStyleFlipHorizo​​ntal在橫向模式下垂直翻轉

有什麼方法可以解決它嗎?

下面是代碼:

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

有同樣的問題.... :) – IronManGill

+0

你呈現視圖控制器之前設置該屬性?在呈現視圖控制器之前,您必須設置此屬性。 –

+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]; 

檢查這...

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

不工作.... –

相關問題