如何在ipad中仅限制纵向模式下的一个屏幕和横向模式下的其他屏幕

如何在ipad中仅限制纵向模式下的一个屏幕和横向模式下的其他屏幕,ipad,ios7,Ipad,Ios7,我的应用程序只在横向模式下运行,但我希望UIImagePicker有一个纵向模式的视图 我在viewController中编写以下代码 (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { return UIInterfac

我的应用程序只在横向模式下运行,但我希望UIImagePicker有一个纵向模式的视图

我在viewController中编写以下代码

 (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return UIInterfaceOrientationIsPortrait(interfaceOrientation);
    } else {
        return (interfaceOrientation = UIInterfaceOrientationPortraitUpsideDown);
    }

}

// iOS6
 (BOOL)shouldAutorotate {
    return YES;
}

// iOS6
 (NSUInteger)supportedInterfaceOrientations {

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

        return  (UIInterfaceOrientationMaskLandscape);
//              return (UIUserInterfaceLayoutDirectionLeftToRight || UIUserInterfaceLayoutDirectionRightToLeft);

    } else {

        return UIInterfaceOrientationMaskPortrait;

    }

}

// Added after comment
 (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return UIInterfaceOrientationLandscapeLeft;
    } else {
        return UIInterfaceOrientationPortrait;
    }

}
在DriveradPage.m上我写了

 (BOOL)shouldAutorotate {
    return YES;
}

// iOS6
 (NSUInteger)supportedInterfaceOrientations {

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {

        return  (UIInterfaceOrientationMaskPortrait);


    } else {

        return UIInterfaceOrientationMaskPortrait;

    }

}
我做错了什么?帮帮我


提前谢谢。

我在申请表中这样做了。通过自定义导航控制器。将您的电子邮件地址发送给我。我会给你发送解决你所有入职问题的代码。