【问题标题】:How to change UIViewController Orientation to UIInterfaceOrientationLandscapeLeft for one view in iOS7如何在 iOS7 中将 UIViewController 方向更改为 UIInterfaceOrientationLandscapeLeft 以获取一个视图
【发布时间】:2014-04-07 12:24:06
【问题描述】:

我尝试了以下方法在我的一个视图上强制横向:

- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;

}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;

}

- (BOOL)shouldAutorotate{
return YES;

}

都没有工作。请注意,我正在模拟器和 iPhone 上进行测试

谢谢

【问题讨论】:

  • 我正在使用 NavigationControler 推送视图。{UINavigationController *navigationController[[UINavigationController alloc]initWithRootViewController:[[MiddleViewController alloc] init]]; [self.windownavigationController];返回是;

标签: objective-c ios7 orientation xcode5.1


【解决方案1】:

请在 Xcode 中转到 Targets 并在 Generate Category 中选择 Device Orientation 勾选 Landscape Orientation。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多