ionic4

How to change the color of custom svg icon in ionic 4?

巧了我就是萌 提交于 2020-06-26 03:12:11
问题 I want to change the color of a custom svg icon on clicking a button <ion-item> <ion-icon src="../../assets/img/icon-qr.svg"></ion-icon> <ion-label>Qr Scan</ion-label> </ion-item> 回答1: I was unable to override an svg stroke or fill if it was specified in the svg. Example: bad svg <svg xmlns="http://www.w3.org/2000/svg" width="20" height="16" viewBox="0 0 20 16"> <g fill="#88AACC" fill-rule="evenodd" stroke-linecap="round" stroke="#555555" stroke-linejoin="round" stroke-width="2"> ... </g> <

How to change the color of custom svg icon in ionic 4?

喜欢而已 提交于 2020-06-26 03:11:11
问题 I want to change the color of a custom svg icon on clicking a button <ion-item> <ion-icon src="../../assets/img/icon-qr.svg"></ion-icon> <ion-label>Qr Scan</ion-label> </ion-item> 回答1: I was unable to override an svg stroke or fill if it was specified in the svg. Example: bad svg <svg xmlns="http://www.w3.org/2000/svg" width="20" height="16" viewBox="0 0 20 16"> <g fill="#88AACC" fill-rule="evenodd" stroke-linecap="round" stroke="#555555" stroke-linejoin="round" stroke-width="2"> ... </g> <

module declares component locally, but it is not exported

徘徊边缘 提交于 2020-06-17 14:39:08
问题 i have created a shared module and declared & exported the component i need in other modules. import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { DateslideComponent } from './dateslide/dateslide.component'; import { IonicModule } from '@ionic/angular'; import { TimeslideComponent } from './timeslide/timeslide.component'; import { AddtimeComponent } from './addtime/addtime.component' @NgModule({ declarations: [DateslideComponent,

How to navigate between pages in ionic 4 & 5?

折月煮酒 提交于 2020-06-15 10:16:38
问题 I had a project that I developed with ionic 3. But I took a break and when I started working again with ionic, I saw the navigation system change in the new versions. My project is a simple project. This project that lists the data in the a array and details about the data appear on a different page. I was doing this on Ionic 3: homepage.ts export class HomePage { items = []; constructor(public navCtrl: NavController) { this.initializeItems();} initializeItems() { this.items = [ { 'title':

How to navigate between pages in ionic 4 & 5?

泪湿孤枕 提交于 2020-06-15 10:13:16
问题 I had a project that I developed with ionic 3. But I took a break and when I started working again with ionic, I saw the navigation system change in the new versions. My project is a simple project. This project that lists the data in the a array and details about the data appear on a different page. I was doing this on Ionic 3: homepage.ts export class HomePage { items = []; constructor(public navCtrl: NavController) { this.initializeItems();} initializeItems() { this.items = [ { 'title':

ionic 4 + angular: routerLink only works first time

☆樱花仙子☆ 提交于 2020-06-11 17:06:33
问题 I'm having a weird bug while developing a basic app from scratch right now. I use Ionic 4 beta 19 and I've put a routerLink to another page, the route is set up in the base pages module like so: RouterModule.forChild([ { path: '', component: NewsPage }, { path: ':id', component: DetailPage } ]) the routerLink attribute is set on a card and it works just fine when clicking on a card, but when I go back and press that same card or another one, the router just doesn't do anything at all. I don't

Why white screen stuck after splash screen in Ionic 4?

时间秒杀一切 提交于 2020-06-08 07:16:13
问题 I run ionic cordova run android for my Ionic Cordova project. At this time, I have my mobile connected to PC via USB. So when I run that command, it installs the app on my real device Android Redmi Note 6 PRO. But what really happens is when the app opens, only white screen appears, nothing else at all. First it shows splash screen and then white screen forever. Why does this behaviour happen? I read somewhere that some people had this problem because of Ionic 4. Below are my logcat logs from

Ionic 4 cannot import custom component is not a know element

送分小仙女□ 提交于 2020-05-29 11:24:48
问题 I am new to Ionic and I want to create a custom listview with expandable items following this link : https://www.joshmorony.com/creating-an-accordion-list-in-ionic/. The problem is that my custom component is never recognized, I have tried many things but nothing works... I am using Ionic 4 and they do not talk of component generation in their doc. The error is : Error: Template parse errors: 'expandable' is not a known element: 1. If 'expandable' is an Angular component, then verify that it

My Hardware 'Back Button Action' is not working in Ionic 4

我怕爱的太早我们不能终老 提交于 2020-05-25 16:02:56
问题 I am working in my Ionic 4 app and When the user clicks 2 times on the mobile back button, then it should close the app but this is not happening. This is my app.component.ts : lastTimeBackPress = 0; timePeriodToExit = 2000; @ViewChildren(IonRouterOutlet) routerOutlets: QueryList<IonRouterOutlet>; constructor(){ this.backButtonEvent(); } backButtonEvent() { document.addEventListener("backbutton", () => { this.routerOutlets.forEach((outlet: IonRouterOutlet) => { if (outlet && outlet.canGoBack(

My Hardware 'Back Button Action' is not working in Ionic 4

て烟熏妆下的殇ゞ 提交于 2020-05-25 15:57:18
问题 I am working in my Ionic 4 app and When the user clicks 2 times on the mobile back button, then it should close the app but this is not happening. This is my app.component.ts : lastTimeBackPress = 0; timePeriodToExit = 2000; @ViewChildren(IonRouterOutlet) routerOutlets: QueryList<IonRouterOutlet>; constructor(){ this.backButtonEvent(); } backButtonEvent() { document.addEventListener("backbutton", () => { this.routerOutlets.forEach((outlet: IonRouterOutlet) => { if (outlet && outlet.canGoBack(