0
我有一个简单的ios导航应用程序。我的问题是在viewController之间浏览,只允许在纵向显示viewController,必须显示在横向viewController。xcode从纵向视图导航到横向视图
问题是,第二个viewController不会显示在加载景观。如果我旋转设备,它会更新,因为它应该,但我希望,因为它只支持横向比它应该自动地捕捉到景观过渡到视图的第一位。有任何想法吗?
感谢
我有一个简单的ios导航应用程序。我的问题是在viewController之间浏览,只允许在纵向显示viewController,必须显示在横向viewController。xcode从纵向视图导航到横向视图
问题是,第二个viewController不会显示在加载景观。如果我旋转设备,它会更新,因为它应该,但我希望,因为它只支持横向比它应该自动地捕捉到景观过渡到视图的第一位。有任何想法吗?
感谢
你应该实施shouldAutorotateToFaceInterfaceOrientation:
在PortraitviewController.m将这个:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return interfaceOrientation == UIInterfaceOrientationPortrait;
}
这在LandscapeviewController.m:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
我已经有这在那里。这似乎没有任何影响的问题。 – Matt
该函数应该在视图加载时调用,是否被调用?检查NSLog的或断点 – WolfLink