Ios6 在IOS 6中使用故事板以横向模式演示modalViewController

Ios6 在IOS 6中使用故事板以横向模式演示modalViewController,ios6,modalviewcontroller,landscape,Ios6,Modalviewcontroller,Landscape,我有一个应用程序,在纵向模式下有一些视图,我想在横向模式下展示模态视图控制器。。。对于IOS 5.0和5.1,它可以完美地工作,在IOS 6中,它可以打开modalView,但处于纵向模式。你需要知道:我使用故事板,我将VC设置为横向。。。 我添加的应用程序内代理: -(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)w {retu

我有一个应用程序,在纵向模式下有一些视图,我想在横向模式下展示模态视图控制器。。。对于IOS 5.0和5.1,它可以完美地工作,在IOS 6中,它可以打开modalView,但处于纵向模式。你需要知道:我使用故事板,我将VC设置为横向。。。 我添加的应用程序内代理:

-(NSUInteger)application:(UIApplication *)application    supportedInterfaceOrientationsForWindow:(UIWindow *)w
{return UIInterfaceOrientationMaskPortrait;}
如果我添加
| UIInterfaceOrientationMaskLandscape
,我可以在其他视图中旋转应用程序

然后,为了便于总结,我禁用了所有支持的界面定向。。 在这里,我尝试将纵向和横向设置为左侧,效果很好,但在这种情况下,我可以将所有视图向左旋转并返回纵向

在我想在景观中享用午餐的ViewCOntroller中,我有以下IOS 6的方法:

-(NSUInteger)supportedInterfaceOrientations
{return UIInterfaceOrientationLandscapeLeft;}

-(BOOL)shouldAutorotate
{return YES;}
当我点击午餐modalView的按钮运行之后,我得到了这个错误:“受支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES”

我知道在这个方法中是关于返回YES的,但是如果我设置NO,什么也不会发生。 我想考虑一下:我的应用程序需要在iOS 5和以后工作。

有人能帮我吗? 如有任何建议,敬请谅解;)

非常感谢

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self transformView2ToLandscape];}

-(void) transformView2ToLandscape {

NSInteger rotationDirection;
UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];

if(currentOrientation == UIDeviceOrientationLandscapeLeft){
    rotationDirection = 1;
}else {
    rotationDirection = -1;
}

CGAffineTransform transform = [arController.viewController.view transform];
transform = CGAffineTransformRotate(transform, degreesToRadians(rotationDirection * 90));
[arController.viewController.view setTransform: transform];}

这对我来说很好。

大家好,我通过添加一个新的导航控制器(在故事板中)来实现这一点,然后通过这个新的导航控制器呈现模态。希望你能处理好这件事。祝你好运;)