javascript

java

python

c#

android

c++

node.js

php

reactjs

jquery

html

css

ios

.net

git

ruby-on-rails

sql

c

string

ruby

android-我收到“错误:找不到与给定名称匹配的资源(值与值@ integer / google_play_services_version匹配)”

我正在Ionic Framework / cordova上开发应用程序,当我尝试“ cordova run android”时,我得到了:

“错误:找不到与给定名称匹配的资源(值为 值@ integer / google_play_services_version)”

我真的不知道发生了什么,我试图用固定值设置值(我知道这不是最好的解决方案),问题仍然存在。

提前致谢!

trans by 2020-07-08T09:17:29Z

角-离子3成分vs Pag

您能告诉我Ionic 3应用程序中的ComponentPage发电机之间有什么区别吗? 似乎我也可以在组件内部使用页面生命周期挂钩,例如ionViewWillLeave,那么我什么时候应该使用角度生命周期挂钩呢? 如果相同,那么为什么有2个发电机? 希望您能对此提供反馈。

组件生成器:

 ionic generate component SubscribeTopicComponent

页面生成器:

ionic generate page LoginPage
trans by 2020-07-06T00:42:07Z

JavaScript-离子含量与ion-header-b重叠

我正在建立基于离子框架的phonegap应用程序。 在一个html页面中,我需要一个标题和一个内容,但是标题与内容重叠。 很抱歉,我没有足够的声誉来发布图像。

代码如下。 html页面与lib文件夹位于同一文件夹中,该文件夹包含ionic css和js文件夹。

    <html>
    <head>
    <meta charset="utf-8">
    <title>Weather</title>

    <!-- Sets initial viewport load and disables zooming  -->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="lib/css/ionic.css">

    <script src="lib/js/ionic.bundle.js"></script>
    <script src="lib/js/angular/angular-resource.js"></script>
    </head>
    <body>
        <ion-header-bar class="bar bar-header bar-dark">
          <h1 class="title">Settings</h1>
          <button class="button button-clear" ng-click="closeSettings()">Close</button>
        </ion-header-bar>
        <ion-content has-header="true">
          <div class="padding">
            <div class="list">
              <label class="item item-input">
                <span class="input-label">Units</span>

                <ion-radio-buttons ng-model="settings.tempUnits">
                  <button class="button button-positive button-radio" ng-value="'f'">&deg;F</button>
                  <button class="button button-positive button-radio" ng-value="'c'">&deg;C</button>
                </ion-radio-buttons>
              </label>
            </div>
          </div>
        </ion-content>

    <!-- <ion-pane id="wrapper"> -->
<!--        <ion-header-bar class="bar bar-header bar-dark">
            <button class="button icon-left ion-chevron-left button-clear button-dark" onclick="goBack()">Back</button>
            <div class="title">xxx</div>
            <button class="button button-icon icon ion-navicon"></button>
        </ion-header-bar>
    </body>
</html>
trans by 2020-06-30T05:08:44Z

角-混合应用-Ionic与NativeScript

我在移动领域已经有一段时间了,我们已经拥有本机Android和iOS应用程序。 现在,我们公司正计划改善我们的移动网站,我们的团队选择了Angular 2 + TypeScript + Ionic2。非常困难的是,我们已经完成了Ionic + Angular的注册表格开发。现在,我开始了解NativeScript在不使用Webview的情况下开发混合应用程序,并且由于它使用了本机UI组件,人们会说该应用程序的外观和性能会很好。

我有点困惑选择一个1. Angular + TypeScript + Ionic(html,js,css)要么2. Angular + TypeScript + NativeScript(xml,js,css)

另外,我们公司的长期计划是维护iOS,Android和移动网站的单一来源

请帮我。

谢谢

trans by 2020-06-25T04:00:11Z

javascript-AngularJS ng单击以转到另一个页面(使用Ionic框架)

理想情况下,当我单击按钮(位于顶部离子导航栏上)时,它应该将我带到另一页。 但是它不起作用。 单击后,导航栏按钮全部消失。

当我使用伪代码时,它可以工作; 警报出现。但是,当我将其交换为实际代码时,它将无法正常工作。

我感觉控制器代码以及URL或视图的引用方式有问题。 但是使用href和ui-sref进行测试也无法产生任何结果。 Google Devt Tools(JS控制台)和Batarang也没有显示任何内容。

有人可以给我指路吗?


虚拟HTML代码

<button class="button button-icon ion-compose" ng-click="create()"></button>


js文件中的虚拟控制器代码

$scope.create = function() {
  alert("working");
};


实际的html代码(我尝试了全部4个版本)

<button class="button button-icon ion-compose" ng-click="create('tab.newpost')"></button>
<button class="button button-icon ion-compose" ui-sref="tab.newpost"></button>
<button class="button button-icon ion-compose" href="/tab/newpost"></button>
<button class="button button-icon ion-compose" ng-click="location.path('/tab/newpost')"></button>


控制器文件(“发布”和“验证”依赖项正常工作)。 当我尝试将URL放入.go()和function()时,应用失败。

app.controller('NavCtrl', function ($scope, $location, $state, Post, Auth) {
    $scope.post = {url: 'http://', title: ''};

    $scope.create = function() {
      /* $location.path('/tab/newpost'); */   /* this variant doesnt work */
      $state.go("/tab/newpost"); 
    };
  });


状态js文件的摘录

.state('tab.newpost', {
      url: '/newpost',
      views: {
        'tab-newpost':{
          templateUrl: 'templates/tab-newpost.html',
          controller: 'NewCtrl'
        }
      }
    });

$urlRouterProvider.otherwise('/auth/login');
trans by 2020-06-22T12:13:56Z

离子框架-Cordova初始屏幕

是否可以禁用cordova默认启动屏幕,我已经删除了插件,但iphone的默认启动屏幕仍在显示,而android白色屏幕仍在显示。可以将其完全移除。

trans by 2020-02-21T22:11:39Z

cordova-离子ios构建失败,找不到错误存档

我一直在试图解决这个问题,但是在隧道尽头似乎没有任何光线,因此请在这里尝试...希望您能提供帮助。

我有一个离子项目。 通过[cordova] error: archive not found at path '/Users/path-to-app/platforms/ios/demoapp.xcarchive' [cordova] ** EXPORT FAILED ** [cordova] [cordova] (node:5866) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,demoapp.xcarchive,-exportOptionsPlist,/Users/path-to-app/platforms/ios/exportOptions.plist,-exportPath,/Users/path-to-app/platforms/ios/build/device [cordova] (node:5866) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.运行可以得到预期的结果,那里没有问题。但是,当运行类似ionic cordova run ios -lc的命令时,我收到一个中断构建过程的错误消息。 我收到的错误如下:

[cordova] error: archive not found at path '/Users/path-to-app/platforms/ios/demoapp.xcarchive' [cordova] ** EXPORT FAILED ** [cordova] [cordova] (node:5866) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error code 65 for command: xcodebuild with args: -exportArchive,-archivePath,demoapp.xcarchive,-exportOptionsPlist,/Users/path-to-app/platforms/ios/exportOptions.plist,-exportPath,/Users/path-to-app/platforms/ios/build/device [cordova] (node:5866) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我在这里看到2个不同的错误:找不到存档和弃用问题。不知道哪个人破坏了构建,但似乎找不到其中一个解决方案。

离子信息:

Ionic:

   ionic (Ionic CLI)  : 4.1.2
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, browser 5.0.4, ios 4.5.5
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   Android SDK Tools : 25.1.7 (/Users/Vincent/Library/Android/sdk)
   ios-deploy        : 1.9.2
   NodeJS            : v9.1.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS High Sierra
   Xcode             : Xcode 10.0 Build version 10A255

任何帮助,将不胜感激!

trans by 2020-02-09T01:50:01Z

离子-移除启动画面上的禁用微调器

我正在尝试在启动初始屏幕上禁用微调器。我找不到此功能的设置。 哪个文件夹/文件?

trans by 2020-02-03T03:48:30Z

javascript-离子框架$ state.go('app.home'); 在我要去的页面上添加后退按钮(如何将其删除)?

我有带有侧边栏菜单的应用程序。 我在第二页上,正在调用控制器函数,该函数使用以下命令将我重定向到第一页:

$state.go('app.home');

问题在于,此页面上现在显示后退按钮,侧边栏菜单图标,请参见下图:

enter image description here

有人可以告诉我如何拒绝在分配了侧边栏菜单的页面中添加后退按钮吗?

谢谢你的帮助。

app.js与路由器配置如下:

angular.module('Test', ['ionic', 'config', 'Test', 'LocalStorageModule'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

.config(function($stateProvider, $urlRouterProvider, localStorageServiceProvider) {
   localStorageServiceProvider
     .setPrefix('max_relax');
   $stateProvider

    .state('app', {
      url: '/app',
      abstract: true,
      templateUrl: 'templates/menu.html',
      controller: 'AppCtrl'
    })

    .state('app.home', {
      url: '/home',
      views: {
        'menuContent' :{
          templateUrl: 'templates/home.html',
          controller: 'HomeCtrl'
        }
      }
    })

    .state('app.saved', {
      url: '/saved',
      views: {
        'menuContent' :{
          templateUrl: 'templates/saved.html',
          controller: 'SavedCtrl'
        }
      }
    })
    .state('app.settings', {
      url: '/settings',
      views: {
        'menuContent' :{
          templateUrl: 'templates/settings.html',
          controller: 'SettingsCtrl'
        }
      }
    });
  // if none of the above states are matched, use this as the fallback
  $urlRouterProvider.otherwise('/app/home');
});

编辑:

添加了菜单模板:

<ion-side-menus>

  <ion-pane ion-side-menu-content>
    <ion-nav-bar class="bar-stable">
      <ion-nav-back-button class="button-clear"><i class="icon ion-ios7-arrow-back"></i> Back</ion-nav-back-button>
    </ion-nav-bar>
    <ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
  </ion-pane>

  <ion-side-menu side="left">
    <header class="bar bar-header bar-stable">
      <h1 class="title">Menu</h1>
    </header>
    <ion-content class="has-header">
      <ion-list>
        <ion-item nav-clear menu-close href="#/app/home">
          Home
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/saved">
          Saved
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/settings">
          Settings
        </ion-item>

      </ion-list>
    </ion-content>
  </ion-side-menu>
</ion-side-menus>
trans by 2020-01-30T08:36:06Z

科尔多瓦:[错误:请安装Android目标:“ android-21”

我刚刚在我的应用程序中更新了cordova + ionic,之后我通过Android SDK管理器成功安装了Android-SDK v22。

但是在运行命令之后:

cordova build android 

我总是收到以下消息:

Running command: /Users/peter/workspace/myapp/platforms/android/cordova/build 
[Error: Please install Android target: "android-21".

Hint: Open the SDK manager by running: /Users/peter/adt-bundle-mac/sdk/tools/android
You will require:
1. "SDK Platform" for android-21
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]
ERROR building one of the platforms: Error: /Users/peter/workspace/myapp/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/peter/workspace/myapp/platforms/android/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1008:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

我也尝试过

cordova platform rm android 
cordova platform add android 

但结果相同:

我试图找到几个小时的任何可行的解决方案,但是很幸运。

感谢您的任何建议。

系统信息:

OS: Mac OS X Yosemite
Node Version: v0.12.0
Cordova CLI: 4.3.0
Ionic Version: 0.9.27
Ionic CLI Version: 1.3.18
Xcode version: Xcode 6.2 Build version 6C131e 
ios-sim version: 3.1.1 
ios-deploy version: 1.4.0 
trans by 2020-01-27T22:00:34Z

离子框架-错误:Node Sass尚不支持您当前的环境:Windows 64位,带有错误

E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj>ionic serve -l
(node:4772) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
There is an error in your gulpfile:
Error: Node Sass does not yet support your current environment: Windows 64-bit with false
For more information on which environments are supported please see:
TODO URL
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\node-sass\lib\index.js:12:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (E:\A Prem World\Team_Work_Tasks\Anjali\Anjali_20160524\QuizApp_20160524_01_Anj\node_modules\gulp-sass\index.js:187:21)
    at Module._compile (module.js:541:32)
trans by 2020-01-27T00:28:12Z

android-基于ioni的播放服务测量基准问题

我在一个离子项目中遇到一个问题,该问题昨天开始发生而未修改任何依赖项。

当我运行platforms/android/build.gradle时出现此错误:

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

但是这些天我没有安装任何依赖项。

这是我的platforms/android/build.gradle列表:

cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin"
cordova-plugin-advanced-http 2.0.9 "Advanced HTTP plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appminimize 1.0.1 "AppMinimize"
cordova-plugin-apprate 1.4.0 "AppRate"
cordova-plugin-appsee 2.6.0 "Appsee"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-datepicker 0.9.3 "DatePicker"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-facebook4 3.2.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-freshchat 1.2.0 "Freshchat plugin for Phonegap"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-inapppurchase-fixed 1.1.0 "In App Purchase"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-media 5.0.2 "Media"
cordova-plugin-nativegeocoder 3.2.2 "NativeGeocoder"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.4 "SocialSharing"
cordova-support-google-services 1.2.1 "cordova-support-google-services"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-deeplinks 1.0.19 "Ionic Deeplink Plugin"
nl.kingsquare.cordova.background-audio 1.0.1 "background-audio"
pushwoosh-cordova-plugin 7.13.0 "Pushwoosh"

我在platforms/android/build.gradle中找到了这些依赖项(如果很高兴知道):

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":CordovaLib"))
    compile "com.android.support:support-v4:24.1.1+"
    compile "com.squareup.okhttp3:okhttp-urlconnection:3.10.0"
    compile "com.google.android.gms:play-services-tagmanager:+"
    compile "com.google.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.firebase:firebase-config:+"
    compile "com.google.firebase:firebase-perf:+"
    compile "com.android.support:support-v4:26.+"
    compile "com.android.support:support-v4:27.+"
    compile "com.android.support:appcompat-v7:27.+"
    compile "com.android.support:recyclerview-v7:27.+"
    compile "com.android.support:design:27.+"
    compile "com.android.support.constraint:constraint-layout:1.0.2"
    compile "com.github.bumptech.glide:glide:4.7.1"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.60"
    compile "com.pushwoosh:pushwoosh:5.13.0"
    compile "com.pushwoosh:pushwoosh-amazon:5.13.0"
    compile "com.pushwoosh:pushwoosh-badge:5.13.0"
    compile "com.pushwoosh:pushwoosh-inbox:5.13.0"
    compile "com.pushwoosh:pushwoosh-inbox-ui:5.13.0"
    compile "com.facebook.android:facebook-android-sdk:4.38.1"
    compile "com.appsee:appsee-android:2.6.0"
    // SUB-PROJECT DEPENDENCIES END
}

我不知道在哪里搜寻。 我在platforms/android/build.gradle中找到了一种禁用GoogleServicesPlugin版本检查的解决方法:com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true,但对我不起作用。

提前致谢。

编辑:似乎我不是唯一的一个。 这里。

trans by 2020-01-26T21:33:54Z

Linux-Ionic Android构建错误-无法找到'ANDROID_HOME'环境变量

我正在尝试为linux中的离子构建android,但它向我显示了这样的错误

     [Error: Failed to find 'ANDROID_HOME' environment variable. 
      Try setting setting it manually.
      Failed to find 'android' command in your 'PATH'. 
      Try update your 'PATH' to include path to valid SDK directory.]
      ERROR building one of the platforms: Error: /home/kumar/myapp/platforms/android/cordova/build: Command failed with exit code 2
      You may not have the required environment or OS to build this project
      Error: /home/kumar/myapp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

我已经在我的bashrc文件中添加了这个

export ANT_HOME="/usr/bin/ant"
export PATH="$PATH:$ANT_HOME/bin"
export HOME="/home/kumar"
export ANDROID_HOME="$HOME/android-sdk-linux/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-sdk-linux/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"

我在想我已经给出了路径,但是我不知道为什么它会向我显示此错误..请帮助...。

trans by 2020-01-26T19:14:07Z

离子2:Cordova不可用。 确保包含cordova.js或在设备/模拟器中运行(在模拟器中运行)

我刚刚设置了第一个ionic 2应用程序(我已经相当广泛地使用ionic 1了)。 我正在尝试使用离子本机相机预览插件。

设置非常简单:

npm install -g ionic cordova
ionic start timesnap --v2
ionic platform add android
ionic platform add ios
ionic plugin add cordova-plugin-camera-preview --save

然后,我将示例代码复制并粘贴到“关于”页面中:

import { CameraPreview, CameraPreviewRect } from 'ionic-native';

// camera options (Size and location)
let cameraRect: CameraPreviewRect = {
  x: 100,
  y: 100,
  width: 200,
  height: 200
};


// start camera
CameraPreview.startCamera(
  cameraRect, // position and size of preview
  'front', // default camera
  true, // tap to take picture
  false, // disable drag
  true, // send the preview to the back of the screen so we can addoverlaying elements
  1 //alpha
);

我使用以下命令启动了该应用程序:

ionic emulate android -lcs

ionic emulate ios -lcs --target='iPhone-6'

起初,相机没有出现,然后我运行chrome://inspect,看到关于Cordova缺少“尝试在模拟器中运行”的警告,但这是在android模拟器中运行。 我也尝试过iOS,结果也一样。

有什么想法为什么cordova没有加载?

这是在Android模拟器中运行时来自chrome://inspect的完整错误日志:

enter image description here

更新... index.html

(这只是由离子产生的标准)

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="UTF-8">
  <title>Ionic App</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">

  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
  <link rel="manifest" href="manifest.json">
  <meta name="theme-color" content="#4e8ef7">

  <!-- cordova.js required for cordova apps -->
  <script src="cordova.js"></script>

  <!-- un-comment this code to enable service worker
  <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('service-worker.js')
        .then(() => console.log('service worker installed'))
        .catch(err => console.log('Error', err));
    }
  </script>-->

  <link href="build/main.css" rel="stylesheet">

</head>
<body>

  <!-- Ionic's root component and where the app will load -->
  <ion-app class="trans"></ion-app>

  <!-- The polyfills js is generated during the build process -->
  <script src="build/polyfills.js"></script>

  <!-- The bundle js is generated during the build process -->
  <script src="build/main.js"></script>

</body>
</html>
trans by 2020-01-22T06:10:26Z

Javascript-离子2:ReferenceError:未定义webpackJsonp

我是Ionic的新手。 我已经开始使用超级模板进行项目。 但是,当我尝试在浏览器中运行该应用程序时。 它抛出一个错误,说:

ReferenceError: webpackJsonp is not defined
    at http://localhost:8100/build/main.js:1:1

我试过将vendor.js放到index.html中,但是没有用。

这是index.html文件。 我删除了vendor.js,因为它不起作用。

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
  <meta charset="UTF-8">
  <title>Ionic App</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">

  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
  <link rel="manifest" href="manifest.json">
  <meta name="theme-color" content="#4e8ef7">

  <!-- cordova.js required for cordova apps -->
  <script src="cordova.js"></script>

  <!-- un-comment this code to enable service worker
  <script>
    if ('serviceWorker' in navigator) {
      navigator.serviceWorker.register('service-worker.js')
        .then(() => console.log('service worker installed'))
        .catch(err => console.log('Error', err));
    }
  </script>-->

  <link href="build/main.css" rel="stylesheet">

</head>
<body>

  <!-- Ionic's root component and where the app will load -->
  <ion-app></ion-app>

  <!-- The polyfills js is generated during the build process -->
  <script src="build/polyfills.js"></script>

  <!-- The bundle js is generated during the build process -->
  <script src="build/main.js"></script>

</body>
</html>
trans by 2020-01-14T10:22:46Z

离子框架-如何在离子项目中自动包裹长字符串

IONIC关于在离子项目中自动换行有两个问题:1.字符串会被结尾处的圆点截断,如何显示没有圆点的完整内容?2.自动换行和响应功能在Firefox中不起作用(Chrome可以),如何在Firefox中解决此问题?

<div class="row responsive-sm">
<div class="col">
    <div class="item item-body">
        <ion-item class="wrap" style="word-wrap: break-word; word-break: break-all;">
        #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion #fashion 
        </ion-item>
    </div>
</div>

任何帮助将非常感激。 最好的祝福。这是完整的HTML来显示问题码笔

trans by 2020-01-02T15:37:16Z

ionic2-在Ionic 2中添加自定义图标

我正在使用Ionic 2开发我的App。 我想在我的应用中使用自定义图标,就像我们使用标记使用ionic 2图标一样。 例如:

<ion-icon name="my-custom-icon"></ion-icon>

我怎样才能做到这一点? 有什么推荐的方法吗?

trans by 2019-11-13T12:16:44Z

JavaScript-错误:npm错误! 结束后写

我在安装Cordova和Ionic时遇到问题。起初我无法安装,因为安装似乎已损坏,这导致我卸载了NodeJS-Cordova-Ionic。

现在,我重新安装了NodeJS,没有任何问题,但是当涉及到著名的一行时:
npm install -g cordova ionic,出现此错误:
npm ERR! write after end然后每次我尝试安装cordova ionic时,对于不同的包装,我都会遇到相同的错误...
这是我得到的错误:

C:\Windows\System32>npm install -g cordova ionic
npm ERR! write after end    
npm ERR! A complete log of this run can be found in:
npm ERR!     d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_31_22_439Z-debug.log    
C:\Windows\System32>npm install -g cordova ionic
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ansi-styles@^3.2.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'chalk'
npm ERR! notarget    
npm ERR! A complete log of this run can be found in:
npm ERR!     d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_40_04_399Z-debug.log    
C:\Windows\System32>
C:\Windows\System32>npm install -g cordova ionic
npm ERR! code ETARGET
npm ERR! notarget No matching version found for supports-color@^5.3.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'chalk'
npm ERR! notarget    
npm ERR! A complete log of this run can be found in:
npm ERR!     d:\Profiles\cjolliet\AppData\Roaming\npm-cache\_logs\2018-03-07T09_44_05_319Z-debug.log

如果任何人可以帮助我,将不胜感激;-)祝你有美好的一天...

编辑1:安装一些软件包并重试之后,我现在有了这个:

npm install -g cordova ionic
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\package.json'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\README.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\superagent-4d7c9590\lib\agent-base.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\path-is-absolute-86a430cb\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\license'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\LICENSE'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\superagent-4d7c9590\lib\client.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\os-tmpdir-c1eaefc0\readme.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parse-glob-106d32b7\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\parseurl-f42ab09d\HISTORY.md'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\opn-07c4c2dd\xdg-open'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\events.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\paginator.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\readline.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\screen-manager.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\readdirp-34d428ea\test\bed\root_dir2\root_dir2_file1.ext1'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\inquirer-b71d51ab\lib\utils\utils.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\readdirp-34d428ea\test\bed\root_dir2\root_dir2_file2.ext2'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\cordova-lib-a64e9936\src\cordova\metadata'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\formats.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\parse.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\stringify.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\qs-095a6ca4\lib\utils.js'
npm WARN tar ENOENT: no such file or directory, lstat 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\cordova-app-hello-world-60bb7e30\template_src\res\icon\blackberry10'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\client.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\index.js'
npm WARN tar ENOENT: no such file or directory, open 'd:\Profiles\cjolliet\AppData\Roaming\npm\node_modules\.staging\tiny-lr-cf15ff1c\src\server.js'
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting readable-stream@^2.0.5:
npm ERR! sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ== integrity checksum failed when using sha512: wanted sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ== but got sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==. (25689 bytes)
trans by 2019-11-10T19:47:44Z

angular-Http StaticInjectorE没有提供程序

我试图从api中提取数据,并在ionic应用程序中填充它,但是当我进入应填充数据的页面时,它崩溃了。 以下是我的两个.ts文件:

import { Component } from '@angular/core';

import { NavController, LoadingController } from 'ionic-angular';
import { RestService } from '../../providers/rest-service/rest-service';

@Component({
  selector: 'page-all-patients',
  templateUrl: 'all-patients.html',
  providers: [RestService]
})
export class AllPatientsPage {
  data: any;
  loading: any;

  constructor(public navCtrl: NavController, public restService: RestService, public loadingCtrl: LoadingController) {

    this.loading = this.loadingCtrl.create({
      content: `
        <ion-spinner></ion-spinner>`
    });
    this.getdata();
  }

  getdata() {
    this.loading.present();
    this.restService.getJsonData().subscribe(
      result => {
        this.data=result.data.children;
        console.log("Success: " + this.data);
      },
      err => {
        console.error("Error : " + err);
      },
      () => {
        this.loading.dismiss();
        console.log('getData completed');
     }
   );
 }
}

和另一个文件:

import { Http } from '@angular/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';

/*
  Generated class for the RestServiceProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/

@Injectable()
export class RestService {

  constructor(public http: Http) {
    console.log('Hello RestServiceProvider Provider');
  }

  getJsonData() {
    // return Promise.resolve(this.data);

     return this.http.get('url').map(res => res.json());
   }

}

我也尝试过使用HttpModule,但这是一个致命错误。 错误如下所示:

Error: Uncaught (in promise): Error: StaticInjectorError[Http]: 
  StaticInjectorError[Http]: 
    NullInjectorError: No provider for Http!
Error: StaticInjectorError[Http]: 
  StaticInjectorError[Http]: 
    NullInjectorError: No provider for Http!
    at _NullInjector.get (http://lndapp.wpi.edu:8100/build/vendor.js:1276:19)

我不确定为什么没有提供程序错误,因为这是通过ionic框架创建的提供程序

trans by 2019-11-07T15:05:47Z

如何为cordova / ionic命令行选择ios模拟器

在使用离子仿真命令行(我假设它与cordova phoengap相同)中,如何选择设备-ipad或iphone高屏。 它始终默认为3.5英寸屏幕。

trans by 2019-11-07T09:29:40Z

1 2 3 下一页 共3页