加载我的设备时处于横向模式。我的父视图控制器也处于横向模式,但presentModelViewController:
我从nib文件加载的视图控制器处于 potrait 模式。
[self performSelectorInBackground:@selector(loginIn) withObject:nil];
loadingAlert = [[LoadingAlert alloc] initWithNibName:@"LoadingAlert" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:loadingAlert];
[navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
[navigationController.navigationBar setBarStyle:UIBarStyleBlack];
[navigationController.navigationBar setOpaque:NO];
[navigationController.navigationBar applyCustomColor];
UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow];
[self presentModalViewController:navigationController animated:NO];
它仅在应用程序第一次运行时发生,除了第一次运行正常。