Ios6 ios 6 presentViewController

Ios6 ios 6 presentViewController,ios6,Ios6,方向在presentViewController中不起作用。甚至我也在使用UINavigationController的类别。已调用supportedInterfaceOrientations方法,但未进行任何更改。在基本视图中,Controller shouldAutorotate方法返回YES。其中我有以下代码 我正在使用此代码。 ViewControllerOne *viewOne = [[ViewControllerOne alloc]init]; UINavigationContro

方向在presentViewController中不起作用。甚至我也在使用UINavigationController的类别。已调用supportedInterfaceOrientations方法,但未进行任何更改。在基本视图中,Controller shouldAutorotate方法返回YES。其中我有以下代码

我正在使用此代码。

ViewControllerOne *viewOne = [[ViewControllerOne alloc]init];

UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:viewOne];
navCtrl.modalPresentationStyle = UIModalPresentationFormSheet;

[self presentViewController:navCtrl animated:YES completion:nil];

请帮帮我。提前感谢…

您使用的是哪个ios 5或ios 6模拟器? 发布更多代码。 你也看到了吗

替换了appDelegate中的此行代码:

[window addSubview:viewController.view];
通过这一行:

[window setRootViewController:viewController];
检查iOS 5和iOS 6

if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
        {
            [self presentViewController:navigationControllerCustom animated:YES completion:nil];
        }
        else
        {
            [self presentModalViewController:navigationControllerCustom animated:YES];
        }
尝试使用旋转

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

您使用的是哪个ios 5或ios 6模拟器? 发布更多代码。 你也看到了吗

替换了appDelegate中的此行代码:

[window addSubview:viewController.view];
通过这一行:

[window setRootViewController:viewController];
检查iOS 5和iOS 6

if ([self respondsToSelector:@selector(presentViewController:animated:completion:)])
        {
            [self presentViewController:navigationControllerCustom animated:YES completion:nil];
        }
        else
        {
            [self presentModalViewController:navigationControllerCustom animated:YES];
        }
尝试使用旋转

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
可能的重复可能的重复