因此,由于我们的项目设置方式的复杂性,我无法删除并添加ios/android。我曾尝试创建一个新的Cordova 3.6项目并安装新的splashscreen插件,但这也没有按预期工作。
我能够解决这个问题,虽然也许不是最好的解决方案,但这是我所做的。
里面的iOS项目的CordovaLib/CDVAvailability.h文件的我添加了两行:
#define CDV_IsIPhone6Plus() ([[UIScreen mainScreen] bounds].size.height == 736 && [[UIScreen mainScreen] bounds].size.width == 414)
#define CDV_IsIPhone6() ([[UIScreen mainScreen] bounds].size.height == 667 && [[UIScreen mainScreen] bounds].size.width == 375)
然后我CDVSplashScreen内。M I加入改变:
if (CDV_IsIPhone5()) {
imageName = [imageName stringByAppendingString:@"-568h"];
}else if (CDV_IsIPad() && isOrientationLocked) {
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
要:
if (CDV_IsIPhone5()) {
imageName = [imageName stringByAppendingString:@"-568h"];
}else if(CDV_IsIPhone6Plus()){
imageName = [imageName stringByAppendingString:@"-568h"];
}else if(CDV_IsIPhone6()){
imageName = [imageName stringByAppendingString:@"-568h"];
} else if (CDV_IsIPad() && isOrientationLocked) {
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
不知道为什么568h图像正常工作,但我想指定736倍667的图像,但没有奏效。简单地添加这两段代码,现在启动屏幕在iPhone 6+和6上正常工作。
不幸的是,此修复程序是每个项目解决方案,因为它涉及编辑科尔多瓦源文件。
您是否使用'xcode6'和'科尔多瓦3.6.3'? – 2014-10-09 16:28:08
使用Xcode 6.1和PhoneGap 3.5 – 2014-10-09 16:29:38
您需要为iOS8使用'cordova 3.6.3' – 2014-10-09 16:30:36