简体   繁体   English

PhoneGap / Cordova + iOS7 + XCode 5

[英]PhoneGap/Cordova + iOS7 + XCode 5

I wast just in the process of finishing an app, then iOS7 was published. 我当时只是在完成一个应用程序,然后发布了iOS7。 I am using Cordova 3.0. 我正在使用Cordova 3.0。

Before I update to XCode 5, compile for iOS7 and nothing is working... I wanted to know if they are working well together? 我更新的XCode 5之前,编译iOS7并没有什么工作...... 我想知道,如果他们合作得很好?

And are the Cordova plugins (connection, splashscreen, notification, storage) still working or do we have to wait for the Cordova Apache Software Foundation to bring out a new version? Cordova插件(连接,启动画面,通知,存储)是否仍在工作,还是我们必须等待Cordova Apache Software Foundation推出新版本?

Thank you very much. 非常感谢你。

If you are getting compilation error after upgrading to iOS 7 and XCode 5 then in this case you need to change your Valid Architecture value under the Build Settings. 如果升级到iOS 7和XCode 5后出现编译错误,则在这种情况下,您需要在“构建设置”下更改“有效架构”值。

change your Architectures value to "armv7" only and delete others after that build you project all the compilation errors will resolve. 将您的Architectures值仅更改为“ armv7”,然后在构建之后删除其他项目,解决所有编译错误。

This fix will work for the Cordova Application only 此修复程序仅适用于Cordova应用程序

I was wondering this myself, so I backed up xcode4 (copied it from the Applications folder to a backup folder) and then updated to xcode5 today. 我本人对此很纳闷,因此我备份了xcode4(将其从“应用程序”文件夹复制到备份文件夹),然后今天更新为xcode5。 (This might be helpful: Can you install the Xcode 5 Developer Preview in parallel with Xcode 4.6.2? ) (这可能会有所帮助: 您可以与Xcode 4.6.2并行安装Xcode 5 Developer Preview吗?

My Phonegap application compiled successfully and runs on the iOS7 simulator. 我的Phonegap应用程序已成功编译并在iOS7模拟器上运行。 So from what I can see, Phonegap 3.0.0 and xcode5 work well together. 因此,从我所看到的来看,Phonegap 3.0.0和xcode5可以很好地协同工作。

Other than that, I believe there are some iOS7 specific configurations that I need to be tweaked, such as: 除此之外,我相信还需要调整一些iOS7特定的配置,例如:

  • different icon sizes for retina displays in iOS7 iOS7中视网膜显示的图标大小不同
  • adding icons for spotlight and settings 添加聚光灯和设置的图标

I'm using cordova 3.0 and xcode 5 too. 我也在使用cordova 3.0和xcode 5。 It seems not any compile error and can run successfully. 似乎没有任何编译错误,并且可以成功运行。 Problem is iOS7's screen length. 问题是iOS7的屏幕长度。 Can use below method to solve the screen length problem. 可以使用以下方法解决屏幕长度问题。 (this is also mentioned as a statusbar hide main ui problem) (这也被称为状态栏隐藏主要用户界面问题)

0, not sure whether the margin-top=20px solution whether work good, because in my environment, I'm also using jquery mobile, so simple set margin-top has no effect. 0,不确定margin-top = 20px解决方案是否工作良好,因为在我的环境中,我也在使用jquery mobile,因此简单设置margin-top无效。

My solution is: 我的解决方案是:

1, Set View controller-based status bar appearance to NO in info.plist file. 1,在info.plist文件中将基于View控制器的状态栏外观设置为NO。

2, Use this code for iOS 7 2,将此代码用于iOS 7

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
    [application setStatusBarStyle:UIStatusBarStyleLightContent];
    self.window.clipsToBounds =YES;
    self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}

Till now, the status bar shows back to like iOS 6 or earlier. 到现在为止,状态栏会像iOS 6或更早的版本一样显示。 But you can find bottom a little hidden under the device scree. 但是您可以在设备屏幕下方找到一些隐藏的底部。 To solve this problem, 为了解决这个问题,

3, Set all jquery mobile and iscrollview footer element padding-bottom=20px. 3,设置所有jquery mobile和iscrollview页脚元素padding-bottom = 20px。

onDeviceReady: function() {
    console.log("onDeviceReady");
    if( parseInt(device.version) >= 7){
        $("footer").css("padding-bottom","20px");
    }
    app.receivedEvent('deviceready');

},

That's all for me to port my Cordova 3.0 + jQuery Mobile + iscrollview app to Xcode 5 + iOS7 . 这就是我将Cordova 3.0 + jQuery Mobile + iscrollview应用程序移植到Xcode 5 + iOS7的全部内容。 Hope it helpful to you. 希望它对您有所帮助。

I'm using Cordova 2.9 and XCode 5 and are working "almost" perfect, the code compiles and even deploy to the phone. 我正在使用Cordova 2.9和XCode 5,并且“几乎”完美地工作,代码可以编译甚至部署到手机上。

The only problem I've found are that the status bar now shows over the app, because the new fullscreen mode. 我发现的唯一问题是,由于新的全屏模式,状态栏现在显示在应用程序上方。

For more info you could see PhoneGap and Cordova with iOS 7 有关更多信息,您可以查看带iOS 7的PhoneGap和Cordova

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

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