我正在使用这段代码
if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
{
[self presentViewController:navigationControllerCustom animated:YES completion:nil];
}
else
{
[self presentModalViewController:navigationControllerCustom animated:YES];
}
我的应用有两个方向:竖屏和倒置竖屏。这段代码在iOS 5.1上运行良好,但是在iOS 6上方向不起作用。
我还在我的navigationControllerCustom
类中添加了这段代码。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
请帮我解决这个问题。
先行致谢。