Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 保留除一个视图外的所有视图_Iphone_Ios_Ios5_Ios6 - Fatal编程技术网

Iphone 保留除一个视图外的所有视图

Iphone 保留除一个视图外的所有视图,iphone,ios,ios5,ios6,Iphone,Ios,Ios5,Ios6,对,我在这方面做了很多研究,遇到了困难 我正在开发一个具有多个视图控制器的应用程序。我有一个“主页”,如果你愿意的话,所有其他的视图都可以从这里访问(这个ViewController.m)。然后,我还将一个UINavigationController.m连接到ViewController.m,以允许完整的导航栏等 我的问题是,我希望所有视图都以纵向显示,除了一个视图,我只希望以横向显示。在我的应用程序选项中,我已将其设置为启用所有方向,然后我读到您应该覆盖根视图控制器(我假设是导航控制器?)中的

对,我在这方面做了很多研究,遇到了困难

我正在开发一个具有多个视图控制器的应用程序。我有一个“主页”,如果你愿意的话,所有其他的视图都可以从这里访问(这个ViewController.m)。然后,我还将一个UINavigationController.m连接到ViewController.m,以允许完整的导航栏等

我的问题是,我希望所有视图都以纵向显示,除了一个视图,我只希望以横向显示。在我的应用程序选项中,我已将其设置为启用所有方向,然后我读到您应该覆盖根视图控制器(我假设是导航控制器?)中的主方向,因此我添加:

- (BOOL)shouldAutorotate {
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
这压倒一切,只有肖像作品。然后,我尝试添加:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}

- (NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscape;
}
我只想在景观中看到,但在模拟器中无法工作

有人能给我一个解决方案吗/

(如果可能,我希望iOS5和iOS6支持)

[编辑]


我应该补充一点,我没有以任何方式编辑AppDelegate

对于那个一个视图,你们需要纵向和横向两个方向的支持?不,我只需要那个一个视图的横向。我想在所有其他视图上强制使用纵向视图,然后在这一视图上强制使用横向视图。我在看这个,但我不确定我要去哪里检查,最后两个方法supportedInterfaceOrientations和supportedInterfaceOrientations放置在视图控制器中,您只需要横向方向?尝试此链接可能会有帮助@Ganapath-这些方法已添加到我希望在横向方向中使用的视图控制器中。