ionic-framework

Ionic app image upload from camera / photo library

萝らか妹 提交于 2019-12-29 03:11:31
问题 I'm working on a ionic chat app where the user can upload a photo as part of their message. I'm looking for a way to upload the image to my webhost server so I can retrieve it later via a URL. The problem is that I'm not able to get it to upload to my web server. I'm using these two plugins: org.apache.cordova.file-transfer cordova-plugin-camera When I run the app in xcode simulator and select a picture from the device photolibrary, the console gives me the following messages: File Transfer

Ionic2 - Displaying project images on the UI

梦想与她 提交于 2019-12-29 02:04:08
问题 I have the following brand new project, created with: $ ionic start MyIonic2Project sidemenu --v2 My question is very simple: where do I locate a directory for application images (asset images / fixed images / icons / etc)?, inside: {resources, src, www, etc}?. I'm looking for best practices . how the url of these images would look like?. I wanna specify the <img src="<url/to/image.jpg>" /> element within the file: src/pages/home/home.ts . 回答1: src/assets/ folder should contain all the

Ionic - White edge on iPhone X in header

陌路散爱 提交于 2019-12-29 01:32:49
问题 Loading an app on iPhone X and I have white bars on the two sides of the notch. I am using Ionic Tabs. I have tried changing the body and ion-app background colour. body, ion-app.app-root { background-color: color($colors, main); } First include viewport-fit=cover Running "cordova-plugin-statusbar": "^2.2.3" Also tried to change Statusbar background colour with <preference name="StatusBarBackgroundColor" value="#25707B" /> Don't know what is causing them. Edit: Added image of the white edge.

Post a form in a new window / inAppBrowser in Ionic (Cordova)

徘徊边缘 提交于 2019-12-28 19:40:06
问题 I want to submit a checkout form to an external url, that should open a new window with the result , but I can't make my app to open it nor in a separate window, nor using the in app browser. What I've done until now is to create a directive with the form inside, and from linker function, call the submit element at some point. When I'm running in browser, this opens a new window (like I want). The problem appears when running on device , because it just REPLACES the content of my view with

ionic2 ion-list with a button both having (click) event

╄→尐↘猪︶ㄣ 提交于 2019-12-28 18:50:22
问题 What I am trying to achieve is when I click on the download button it should do somthing else and when clicking on the item it should open a new window <ion-list> <ion-item *ngFor="let reading_material of reading_materials" (click)="gotoReadingMaterial(reading_material)"> {{reading_material.title}} <ion-icon item-right name="download" (click)="downloadMaterial(reading_material)"></ion-icon> </ion-item> </ion-list> But when I click on the download button, both the events gets hit. Is there a

Ionic 2 Modal make 50% of the width

青春壹個敷衍的年華 提交于 2019-12-28 11:47:28
问题 I have a page in my ionic application that on button click opens a Modal Page. Currently, I have override the variable.scss to the code below to make the model cover the 100% of the page. //for Modals $modal-inset-height-large: 100%; $modal-inset-height-small: $modal-inset-height-large; $modal-inset-width: 100%; However, this applies for all my models in my application. I want to use some models in other pages that use the 50% of the width and around 80% of the height. How can I customize my

ionic serve displays multiple addresses and I chose wrong one…How to change address that ionic serve uses?

独自空忆成欢 提交于 2019-12-28 11:44:11
问题 I used ionic serve and got the below response to which I did not think twice and selected localhost . However now I want to use option 1. Ionic has remembered my selection such that ionic serve never allows me to select anymore and uses localhost ... How can I change this so that ionic serve uses the first option? Multiple addresses available. Please select which address to use by entering its number from the list below: 1) 192.168.2.10 (en0) 2) localhost Address Selection: 回答1: You can use

NavController doesn't work in Ionic 4

删除回忆录丶 提交于 2019-12-28 11:13:07
问题 I'm injecting NavController in my constructor as I want to push a page. But, below code doesn't work in Ionic 4. It was totally okay in Ionic 3. Constructor constructor(public menuCtrl: MenuController, public navCtrl: NavController) { this.menuCtrl.enable(true); } Method goToSecondPage() { this.navCtrl.push(list); } 回答1: Now, to complete the final step and implement those routes in our app-routing.module.ts file, they would look like this: const routes: Routes = [ { path: '', redirectTo: '

NavController doesn't work in Ionic 4

南笙酒味 提交于 2019-12-28 11:12:09
问题 I'm injecting NavController in my constructor as I want to push a page. But, below code doesn't work in Ionic 4. It was totally okay in Ionic 3. Constructor constructor(public menuCtrl: MenuController, public navCtrl: NavController) { this.menuCtrl.enable(true); } Method goToSecondPage() { this.navCtrl.push(list); } 回答1: Now, to complete the final step and implement those routes in our app-routing.module.ts file, they would look like this: const routes: Routes = [ { path: '', redirectTo: '

How to use angular 2 service with Ionic 2?

独自空忆成欢 提交于 2019-12-28 04:00:07
问题 I am new to Ionic 2. I read in angular 2 docs, that service needs to be injected while bootstrap application. But could not see any bootstrap thing while going through Ionic 2 tutorial. Any help is highly appreciated. 回答1: There is no use of Bootstrap() in Ionic2, only use of @App to declare your app. You still need to declare your service in your @Page component. Create your service import {Injectable} from "angular2/core"; import {Http} from "angular2/http"; @Injectable() export class