由于一些奇怪的原因,模拟器/设备不会改变我的应用程序的方向。我的代码不被弃用,根据在Xcode 6.2上使用它的人,他们说它有效。但是,对于我的iOS 8模拟器和设备,它不会旋转。我只使用了Portrait和UpsideDown方向。我拥有应该在info.plist和部署信息中的所有方式。
Xcode 6.1上是否有按钮,我可能不小心点击了锁定模拟器/设备的方向?
-(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
//在appdelegate.m ...
CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size;
if (iosScreenSize.height == 667) {
UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];
UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}