简体   繁体   English

在iPad上显示黑屏的phonegap iPhone应用程序

[英]phonegap iphone app showing black screen on iPad

I am developing and testing my iphone app (phonegap + native) properly on iPhone simulator and device. 我正在iPhone模拟器和设备上正确开发和测试我的iPhone应用程序(phonegap +本机)。

However, when testing on iPad simulator or device, I can only see a blank black screen and no errors on console. 但是,在iPad模拟器或设备上进行测试时,我只能看到黑屏,而控制台上没有错误。

Target family is properly set to iPhone and window makeKeyAndVisible also executed! 目标家庭已正确设置为iPhone,并且还执行了窗口makeKeyAndVisible! 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. 黑屏几乎总是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. 假设您使用的是iOS 6,您应该能够连接桌面野生动物园网络检查器并查找任何JavaScript错误,这些错误不会在Xcode控制台中显示。

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. 要测试的另一件事是,该应用程序仍可以在iPhone上进行全新安装-更新现有应用程序仅会复制新文件和更新文件,因此不会显示由删除引起的错误,例如重命名脚本和保留对旧文件名的引用马上起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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