【发布时间】:2012-09-30 01:07:00
【问题描述】:
刚刚更新到 IOS SDK 6,现在我很困惑。试图找到解决方案,但我失败了。
- 在 xcode 中创建了一个新的“Single View iPad APP”(我有一台 iPad 3)
- 在 TARGETS->Summary 中禁用 Portrait & Upside-Down 界面方向
- 将模拟指标“方向”设置为“横向”
-
在视图控制器文件中添加了以下代码行:
- (BOOL)shouldAutorotate { return YES; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSLog(@"%@", NSStringFromCGRect(self.view.frame)); } 运行应用程序
我的输出是:2012-10-09 18:18:40.149 TestApp[6165:907] {{20, 0}, {748, 1024}} 有人知道为什么框架不像我期望的那样 ... {{0, 20}, {1024, 748}} 吗?也许我错过了什么!
谢谢!
【问题讨论】:
标签: xcode ipad uiview uiviewcontroller ios6