简体   繁体   中英

phonegap iphone app showing black screen on iPad

I am developing and testing my iphone app (phonegap + native) properly on iPhone simulator and device.

However, when testing on iPad simulator or device, I can only see a blank black screen and no errors on console.

Target family is properly set to iPhone and window makeKeyAndVisible also executed! How to solve it?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    UIViewController *introVC = [[videoViewController alloc] initWithNibName:@"videoViewController" bundle:nil];

    UIViewController *blogVC = [[blogViewController alloc] initWithNibName:@"blogViewController" bundle:nil];

    NSArray *viewControllers = [NSArray alloc];

    viewControllers = [NSArray arrayWithObjects: introVC, blogVC, nil];

    [rootController setViewControllers:viewControllers animated:NO];

    self.rootController.selectedIndex = 0;

    [window setRootViewController:self.rootController];
    [window makeKeyAndVisible];

    return YES;
}

A black screen is pretty much always an error in the javascript. Assuming you are using iOS 6 you should be able to attach the desktop safari web inspector and look for any javascript errors, which will not show up in the Xcode console.

Another thing to test is that the app still works as a clean install on iPhone - updating an existing app only copies new and updated files, so errors caused by deletion such as renaming a script and leaving a reference to the old filename won't show up right away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM