所以,我有我的AppDelegate.m此功能:
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
[CDVLocalStorage __verifyAndFixDatabaseLocations];
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
if (url && [url isKindOfClass:[NSURL class]]) {
invokeString = [url absoluteString];
NSLog(@"PHR launchOptions = %@", url);
}
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:screenBounds];
self.window.autoresizesSubviews = YES;
self.detailViewController
self.detailViewController = [[MainViewController alloc] init];
self.detailViewController.useSplashScreen = YES;
self.detailViewController.wwwFolderName = @"www";
self.detailViewController.startPage = @"index.html";
self.detailViewController.invokeString = invokeString;
NSString *deviceType = [UIDevice currentDevice].model;
if (![deviceType hasPrefix:@"iPad"] && ![deviceType hasPrefix:@"iPad Simulator"])
{
CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
detailViewController.view.frame = viewBounds;
BOOL forceStartupRotation = YES;
UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationUnknown == curDevOrientation) {
curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
}
if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
if ([self.detailViewController supportsOrientation:curDevOrientation]) {
forceStartupRotation = NO;
}
}
if (forceStartupRotation) {
UIInterfaceOrientation newOrient;
if ([self.detailViewController supportsOrientation:UIInterfaceOrientationPortrait])
newOrient = UIInterfaceOrientationPortrait;
else if ([self.detailViewController supportsOrientation:UIInterfaceOrientationLandscapeLeft])
newOrient = UIInterfaceOrientationLandscapeLeft;
else if ([self.detailViewController supportsOrientation:UIInterfaceOrientationLandscapeRight])
newOrient = UIInterfaceOrientationLandscapeRight;
else
newOrient = UIInterfaceOrientationPortraitUpsideDown;
NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation);
[[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
}
self.window.rootViewController = self.detailViewController;
} else {
NavViewController *leftViewController = [[NavViewController alloc] initWithNibName:@"NavViewController" bundle:nil];
UINavigationController *leftNavViewController = [[UINavigationController alloc] initWithRootViewController:leftViewController];
leftNavViewController.navigationBarHidden = YES;
UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
detailNavigationController.navigationBarHidden = YES;
leftViewController.detailViewController = detailViewController;
self.splitViewController = [[UISplitViewController alloc] init];
self.splitViewController.viewControllers = [NSArray arrayWithObjects:leftNavViewController, detailNavigationController, nil];
self.window.rootViewController = self.splitViewController;
self.splitViewController.delegate = detailViewController;
detailViewController.svc = self.splitViewController;
}
[self.window makeKeyAndVisible];
return YES;
}
是的,我知道这是一个很大的代码,但我完全不确定的东西剪断,因为这个功能里面我不知道什么是错的究竟做。
从本质上讲,在横向模式下的iPad,但闪屏我的应用程序加载时旋转90度,并显示画像,而不是风景,然后闪回我的实际闪屏。 从看代码,我可以告诉大家,它的烧制设备检查的else语句,除此之外,我真的可以用你的球员在搞清楚什么改变,我需要做的帮助。