将phoneGap与本机iOS应用程序集成 [英] Integrating phoneGap with native iOS app

查看:126
本文介绍了将phoneGap与本机iOS应用程序集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个使用本机功能和phoneGap框架的组合的应用程序。原生应用程序有一个按钮,点击后它的phoneGap ui必须添加到视图。有什么办法实现这个吗?有没有相同的教程?

i'm trying to create an app which uses the combination of native functionality and the phoneGap framework. The native app has a button, upon the click of which the phoneGap ui has to be added to the view. Is there any way to achieve this? Are there any tutorials for the same?

推荐答案

是的,这是可能的。虽然你可能会让自己陷入一些头痛。我的应用程序有相反的方式,它大多是phonegap,但偶尔,我会弹出一个视图是原生的。这里是代码的链接,显示了如何在iOS和phonegap世界之间切换的一个很好的例子。

Yes, this is possible. Although you might be getting yourself into some headaches. My app kind of goes the other way around, it's mostly phonegap, but occasionally i'll pop open a view that is native. Here is the link to code that shows an excellent example of how to switch between the iOS and phonegap worlds.

new updated recommended article (see update below)

这些文件表示在phonegap中使用的标准插件。在这个特定的插件中,本地视图被打开在手机视图的顶部。注意你有一个自定义的xib和一切。这个插件可以修改显示任何xib与任何功能,你可以想到。

These files represent a standard plugin used in phonegap. In this particular plugin, a native view is opened on top of a phonegap view. Notice you have a custom xib and everything. This plugin can be modified to display any xib with any functionality you could think of.

如果你实现这个插件,你会很容易看到如何来回跳跃。我已成功地大量修改这些类,以添加LOTS的本机功能到我的phonegap项目。此外,你应该可以查看phonegap插件的官方phonegap指南。 此处

If you implement this plugin you will easily see how to jump back and forth. I've successfully heavily modified these classes to add LOTS of native capabilities to my phonegap project. Also you should probably check out the official phonegap guide to phonegap plugins. Here

重要编辑

通知原始链接已损坏(不太可怕,因为此答案非常旧, )所以我用一篇文章替换了原来的链接,显示如何做这些插件。在文章中,它解释了链接是破碎的,并提供了几个链接,这些旧的文件,但事实上,这些也是破碎。 这里是其中一个分支,我发现仍然是主机在归档分支上的原始文件。但我没有调查这些文件是否与我原来的工作有很大的不同。祝你好运!

Was informed original linkwas broken (not terribly surprised as this answer is very old and i've long since moved away from Phonegap) so I replaced the original link with an article that shows how to do these plugins well. In the article it explains the link is broken and gives several links where these older files are maintained, but in fact those are broken as well. Here is a branch of one of them I found that still hosts the original files on an "archive" branch. But I haven't investigated whether these files are wildly different from my original work. Good luck!

这篇关于将phoneGap与本机iOS应用程序集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆