Html phonegap/cordova 可以使用原生 GUI 吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14539214/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 05:15:48  来源:igfitidea点击:

Can phonegap/cordova use native GUI?

htmluser-interfacecordovanative

提问by DanielJ

Might sound stupid but can phonegap/cordova use the devices native GUI? I know its a web wrapper but i understand that you have access to some native calls ( like camera/contacts etc )

听起来可能很愚蠢,但 phonegap/cordova 可以使用设备本机 GUI 吗?我知道它是一个网络包装器,但我知道您可以访问一些本机调用(如相机/联系人等)

Thanks

谢谢

采纳答案by Young Kasey

AppGyver Steroidsunites PhoneGap and Native UI very neatly.

AppGyver Steroids非常巧妙地结合了 PhoneGap 和 Native UI。

Basically, with Steroids you can very easily add things like native tabs, native navigation bar, native animations and transitions, native modal windows, native "Facebook style" drawer/panel etc. to your PhoneGap app.

基本上,使用 Steroids,您可以非常轻松地向 PhoneGap 应用程序添加诸如本机选项卡、本机导航栏、本机动画和过渡、本机模态窗口、本机“Facebook 风格”抽屉/面板等内容。

Here's a demo of how it works: http://youtu.be/oXWwDMdoTCk?t=20m17s

这是它如何工作的演示:http: //youtu.be/oXWwDMdoTCk?t=20m17s

回答by TWilly

I just found out about the Monaca framework which is similar to AppGyver where they have built cordova plugins for native ui transitions. Monaca's native ui code is on GitHub and you are free to download it and install it in your existing phoengap project or use their cloud integration system.

我刚刚发现 Monaca 框架,它类似于 AppGyver,他们为原生 ui 转换构建了cordova插件。Monaca 的原生 ui 代码在 GitHub 上,您可以免费下载并将其安装在您现有的 phoengap 项目中或使用他们的云集成系统。

http://monaca.mobi/

http://monaca.mobi/

回答by Lidakis Emmanuel

You can check Project Ace, I think it's your best bet for (ios & android cordova-phonegap apps) until now, and it's backed by Microsoft.

您可以查看Project Ace,我认为这是迄今为止(ios 和 android cordova-phonegap 应用程序)的最佳选择,并且得到了 Microsoft 的支持。

Some Pros:

一些优点:

  • Great flexibility and independent,
  • Invoke native code,
  • Mix and match native components with html,
  • Write platform specific code (ios & android),
  • Great docking system for ui design and layout management,
  • Create Android Widgets,
  • Great documentation,
  • Works with any mobile hybrid framework (e.g Ionic).
  • 极大的灵活性和独立性,
  • 调用本机代码,
  • 将原生组件与 html 混合搭配,
  • 编写特定于平台的代码(ios 和 android),
  • 用于ui设计和布局管理的出色对接系统,
  • 创建 Android 小部件,
  • 很棒的文档,
  • 适用于任何移动混合框架(例如 Ionic)。

Update: As of December 2016, this project is no longer maintained by Microsoft.

更新:截至 2016 年 12 月,该项目不再由 Microsoft 维护。

But is still on github and of course it's open-source.

但仍然在 github 上,当然它是开源的。

回答by Rajesh

Technically, it is possible to use anything native using a plugin. Refer Plugin Development Guidefor more info. The caveat is that this plugin has to be written for all the target platforms.

从技术上讲,可以使用插件使用任何本机。有关更多信息,请参阅插件开发指南。需要注意的是,必须为所有目标平台编写此插件。

Using a native GUI, though, defeats the purpose of using Cordova, except in rare cases where it is absolutely required to show native components (Dialog boxes, for example, for which you can use notification.alert)

但是,使用本机 GUI 会破坏使用 Cordova 的目的,除非在极少数情况下绝对需要显示本机组件(例如,您可以使用对话框notification.alert

回答by Phobox

Yep, before your start writing your own.. check if it's not already done :)

是的,在你开始自己写之前..检查它是否还没有完成:)

phonegap / phonegap-plugins

phonegap / phonegap 插件

Hope it helps.

希望能帮助到你。

回答by Prangya

Ofcourse you can write native controls. You can create programatically using plugins. and also can use the xml files (like android native app uses )to create the controls but for that you have to use the cordova webview.

当然,您可以编写本机控件。您可以使用插件以编程方式创建。并且还可以使用 xml 文件(如 android 本机应用程序使用)来创建控件,但为此您必须使用cordova webview。