2011-01-27 63 views
1

通常,我的应用程序会以纵向模式显示除报告视图外的所有视图。报告视图仅在我处于设置视图时显示,并将设备旋转到横向模式。现在,当我再次将我的设备旋转到肖像模式时,报告视图被取消并显示设置视图。将肖像旋转到我的视图控制器的横向和纵向模式

In report view 

> shouldAutorotateToInterfaceOrientation 

return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight)||(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)); 



Here at settings view 

    shouldAutorotateToInterfaceOrientation 


    if((interfaceOrientation == UIInterfaceOrientationLandscapeRight)||(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)) 
    { 

    Report *report = [[Report alloc]initWithNibName:@"Report" bundle:[NSBundle mainBundle]]; 
    [self.navigationController pushViewController:report animated:YES]; 
    [report release]; 

    } 
    return YES; 
    } 
+0

你面对的确切问题是什么?您是否能够在横向模式下看到您的报告视图?如果是,请解释下一步你需要的。 – 2011-01-28 08:50:22

回答

1

不要在shouldRotate创建视图 - 控制......,但在willRotateToInterfaceOrientation:duration:,这是你应该在哪里,以旋转回应。在您的shouldAutorotateToInterfaceOrientation:中,当您想要旋转到该方向时返回YES,在您的情况下,它看起来像要么是所有方向,要么是除了PortraitUpsideDown之外的所有方向。

在你的willRotateToInterfaceOrientation:duration:,你可以推动你的视图控制器或按需要弹出它。

相关问题