将Cordova应用程序更改为离子项目或在cordova应用程序中使用离子功能 [英] Changing a Cordova app into a ionic project or using an ionic feature in a cordova app

查看:57
本文介绍了将Cordova应用程序更改为离子项目或在cordova应用程序中使用离子功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前几乎在Cordova应用程序的开发阶段即将结束,并想为该应用程序的iOS端实现向后滑动功能.为此,在网上搜索时,我认为我需要离子性离子.我在计算机上也安装了离子产品 在Visual Studio上安装了扩展程序.首先,有什么方法可以在不将我的应用程序实际更改为离子项目的情况下使用向后滑动功能? (尽管不太可能这是最理想的选择,因为一切都正常,我 只需要一项功能!).如果没有,是否可以将我的cordova应用程序更改为离子项目?如果可能的话,该怎么办?

I am currently almost at the end of the development stages of a cordova app and would like to implement the swipe back feature for the iOS side of the app. To do this, upon an online search, I figured I'd need ionic. I installed ionic on my computer and also installed the extensions on visual studio. First of all, is there any way how I can use the swipe back feature without actually changing my app into a ionic project? (Although unlikely this would be the most ideal since everything is in working order and I just need one feature!). If not, is it possible to change my cordova app into a ionic project? If possible, how can that be done?

谢谢您的帮助!

推荐答案

  ;>>如何在不实际将应用程序更改为离子项目的情况下使用向后滑动功能?

据我所知,向后滑动功能与ionic-nav-view协作,后者是离子框架的一部分.因此,不太可能将其隔离 功能.

As far as I know, Swipe Back functionality cooperates with ionic-nav-view, which is a part of ionic framework. So, it is unlikely to isolate this functionality.

>>  如果没有,是否可以更改我的科尔多瓦 应用程序进入离子项目?如果可能的话,该怎么办?

>> If not, is it possible to change my cordova app into a ionic project? If possible, how can that be done?

The答案是肯定的.您可以通过在项目中添加离子框架来使用离子特征.为此,请按照下列步骤操作 下方:

The answer is yes. You can use ionic features by adding ionic framework into your project. To achieve this, follow the steps below:

1 .打开bower.json文件,将内容替换为以下内容:

{
  "name": "MyCordovaApp",
  "private": true,
  "dependencies": {
    "ionic": "driftyco/ionic-bower#1.2.4"
  },
  "resolutions": {
    "angular": ">= 1.0.8",
    "angular-animate": "1.5.3",
    "angular-sanitize": "1.5.3"
  }
}


片刻之后,Visual Studio将添加ionic(1.2.4)库放到Dependencies \ Bower文件夹中.如果不是,请右键单击依赖项"并还原 包.

after a short moment, visual studio will add ionic(1.2.4) library into your Dependencies\Bower folder. If not, right-click Dependencies item and restore package.

2.添加一个".bowerrc"文件位于项目的根文件夹下.在此文件中添加以下内容:

{
  "directory": "www/lib"
}

再过一会儿,vs将添加离子性库放入"www/lib"文件夹.

3.添加对"www/lib/ionic/js/ionic.bundle.js"的引用.和"www/lib/ionic/css/ionic.css";到项目的根页面.

4 .添加 ionic-plugin-keyboard 插件 进入您的项目.

4. Add ionic-plugin-keyboard plugin into your project.

5 .使您的项目与ionic-nav-view合作.您可以参考以下官方文档: ion-nav-view .

希望这对您有用,

最好的问候.


这篇关于将Cordova应用程序更改为离子项目或在cordova应用程序中使用离子功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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