【发布时间】:2014-02-25 14:53:58
【问题描述】:
我有以下场景:
我从 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 的问题,虽然我已将其限制为纵向模式。我做错了什么?
【问题讨论】:
标签: ios uinavigationcontroller landscape-portrait