ionic-framework

Ionic splash screen and spinner

别来无恙 提交于 2019-12-30 10:44:11
问题 Is there a way to customize spinner in splash screen? Currently I am using cordova splashscreen plugin and I want to change the color of spinner that appears on the splash screen. 回答1: In platforms/android/src/org/apache/cordova/splashscreen/SplashScreen.java , at the top: import android.graphics.drawable.Drawable; import android.content.res.Resources; And further down the bottom replace with this function: // Show only spinner in the center of the screen private void spinnerStart() { cordova

Ionic: How to override back button function?

风格不统一 提交于 2019-12-30 10:08:39
问题 I need to override the back button function for both buttons: the back icon on top left corner of nav-bar the hardware back button (for example in android) but only for one specific view, not globally. How can i do that? 回答1: This code is for android button, while the button on the navigation bar is a bit more simple: Android button : $ionicPlatform.registerBackButtonAction(function (event) { if($state.current.name=="home"){ alert("button back"); } }, 100); Ionic button : You can edit your

Angular 6 http post request with x-www-form-urlencoded data

佐手、 提交于 2019-12-30 09:32:37
问题 I have been trying to make a post request to my backed API to post some data. I have tried this API using postman and it works fine and the data is returned properly. However, when I try to do the same from my ionic-angular app, it doesn't work at all. I have tried most of the methods available on the web, but to no avail. I am building this app with Angular v6.0.8 and Ionic framework v4.0.1. The API expects application/x-www-form-urlencoded data in the request body (includes username,

Angular 6 http post request with x-www-form-urlencoded data

♀尐吖头ヾ 提交于 2019-12-30 09:32:18
问题 I have been trying to make a post request to my backed API to post some data. I have tried this API using postman and it works fine and the data is returned properly. However, when I try to do the same from my ionic-angular app, it doesn't work at all. I have tried most of the methods available on the web, but to no avail. I am building this app with Angular v6.0.8 and Ionic framework v4.0.1. The API expects application/x-www-form-urlencoded data in the request body (includes username,

Creating ionic resources for iOS doesn't work anymore

核能气质少年 提交于 2019-12-30 09:02:46
问题 I'm preparing my ionic app for an update in the iOS app store but I'm really stuck at the moment because generating resources using ionic resources doesn't work anymore. After running the command in the terminal it starts uploading the resources I put into the folder, then tells me uploading was sucessfully completed and then freezes completely. Android and iOS folders get created, also the icon and splash folder, but then nothing more happens. What I tried so far: - replacing the icon.psd

Creating ionic resources for iOS doesn't work anymore

╄→尐↘猪︶ㄣ 提交于 2019-12-30 09:02:08
问题 I'm preparing my ionic app for an update in the iOS app store but I'm really stuck at the moment because generating resources using ionic resources doesn't work anymore. After running the command in the terminal it starts uploading the resources I put into the folder, then tells me uploading was sucessfully completed and then freezes completely. Android and iOS folders get created, also the icon and splash folder, but then nothing more happens. What I tried so far: - replacing the icon.psd

Cannot find namespace NodeJS when using NodeJS.Timer in Ionic 2

我们两清 提交于 2019-12-30 07:54:19
问题 I am attempting to use some code I found on https://github.com/bevacqua/dragula/issues/289#issuecomment-277143172 to my Ionic project. When I run the code I get an error Cannot find namespace 'NodeJS' and the error refers to touchTimeout: NodeJS.Timer; How can I adapt the code below to make the NodeJS.Timer line work? import { Directive, ElementRef, HostListener } from '@angular/core'; @Directive({ selector: '[delayDragLift]' }) export class DelayDragLiftDirective { dragDelay: number = 200; /

Google Maps on Ionic Framework/Cordova not working on android build

久未见 提交于 2019-12-30 06:54:26
问题 I have been writing code for an app to track user location and display it using Google Maps. My code works perfectly in browsers (Safari,Firefox,Chrome) but doesn't work at all on mobile (android). The google maps api doesn't work and the navigation is unreliable. I'm a ionic newbie and wrote a fairly simple app to test it out. It has got ionic side menu template with some simple AngularJS controller. angular.module('starter.controllers', []) .controller('AppCtrl', function($scope,

Google Maps on Ionic Framework/Cordova not working on android build

感情迁移 提交于 2019-12-30 06:54:16
问题 I have been writing code for an app to track user location and display it using Google Maps. My code works perfectly in browsers (Safari,Firefox,Chrome) but doesn't work at all on mobile (android). The google maps api doesn't work and the navigation is unreliable. I'm a ionic newbie and wrote a fairly simple app to test it out. It has got ionic side menu template with some simple AngularJS controller. angular.module('starter.controllers', []) .controller('AppCtrl', function($scope,

Is it possible to create Ionic 2 project in Ionic 3 CLI

我怕爱的太早我们不能终老 提交于 2019-12-30 05:27:07
问题 When I do this, I get the message below: Command : ionic start blank myapp --v2 Error : [ERROR] Sorry! The --v1 and --v2 flags have been removed. Use the --type option. (ionic start --help) For Ionic Angular projects, try ionic start blank myapp --type=ionic-angular My Ionic CLI version is : ionic -v 3.3.0 回答1: Update 2 : You can no longer create Ionic 2 project in Ionic 3 CLI. As Ionic 2 was not updated & is rewritten using Ionic 3, which uses Angular 4. So if you create new Ionic project it