2
我有以下情形:IOS縱向和橫向模式
從的appDelegate我做的:
firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UINavigationController *firstNavController = [[UINavigationController alloc]initWithRootViewController:firstViewController];
firstViewController - 需要只在人像模式
爲了做到這一點我做了:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
從firstViewController
我是推另一個視圖控制器需要具有縱向和橫向功能。
像預期的那樣secondViewController
行爲 - 在波泰特和橫向模式
我有顯示在橫向模式也與firstViewController問題,雖然我已經將其限制在肖像模式。我究竟做錯了什麼?
它不能解決我的問題。我的視圖仍然可以在橫向和縱向模式下旋轉 –
我對shouldAutorotateToInterfaceOrientation方法發表了評論。 –
您的意思是評論shouldAutoRotate解決了您的問題? – Rajesh