我将我的应用设置为仅支持横向。如果 iPad 模拟器设备 OrientationLandscapeRight 当我从 nib 文件启动我的应用程序时,它会从 UIInterfaceOrientationLandscapeRight 快速自动旋转到 UIInterfaceOrientationLandscapeLeft。但是如果 iPad 模拟器 OrientationLandscapeLeft 或应用程序中的代码:didFinishLaunchingWithOptions:没有任何反应。
-(void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation{
NSLog(@"%d%d%d%d",UIInterfaceOrientationPortrait
,UIInterfaceOrientationPortraitUpsideDown
,UIInterfaceOrientationLandscapeLeft
,UIInterfaceOrientationLandscapeRight);
NSLog(@"%d",oldStatusBarOrientation);}
从 nib 文件启动的日志:
2013-09-11 11:12:33.235 文仙记[925:15203] 1243
2013-09-11 11:12:33.238 文仙记[925:15203] 1
2013-09-11 11:12:33.251 文仙记[925:15203] 1243
2013-09-11 11:12:33.253 文仙记[925:15203] 3
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
_spvc = [[MySplitViewController alloc] init];
_master = [[MasterViewController alloc] init];
_detail = [[DetailViewController alloc] init];
_spvc.delegate = _detail;
_spvc.viewControllers = @[_master, _detail];
_master.detailViewController = _detail;
[self.window setRootViewController:_spvc];
[self.window makeKeyAndVisible];
return YES;}
程序时的日志:
2013-09-11 11:26:34.757 文仙记[960:15203] 1243
2013-09-11 11:26:34.760 文仙记[960:15203] 1