使用 Tabs 推送新页面时 Ionic3 背景消失
Ionic3 background disappears when push a new page with Tabs
我尝试在我的应用程序中推送一个带有选项卡的新页面。但是,我发现当我点击按钮(添加朋友)时,右侧弹出新页面,背景页面突然消失。当我单击新页面(组件)左上角的后退按钮时。你会发现背景层只显示白色,新页面完全关闭后,欢迎页面又出现了。
示例:
你可以在下面看到我的代码:
如果您需要,这里是代码:https://stackblitz.com/edit/ionic-mfc3ga
- open the link in Chrome
- clicking "open in new window" on the top right of the page.
- In new window, open development tools(Chrome) and switch to mobile model(toggle device toolbar) and please refresh the browser.
- clicking the "add friend button" on the top right.
- you will see the background page(Welcome to Ionic) disappearing when the new page slides from right to left.
- In addition, when you click back button on the top left in new page(component). you will find that the background layer only shows
white, and after the new page closing completely, the welcome page
shows again.
我不知道我的代码有什么问题。
谢谢大家
删除 import { AboutPage } from '../about/about';
到关于页面
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
// import { AboutPage } from '../about/about'; DELETE THIS
import { ContactPage } from '../contact/contact';
import { HomePage } from '../home/home';
@Component({
selector: 'page-about',
templateUrl: 'about.html'
})
export class AboutPage {
tab1Root = HomePage;
// tab2Root = AboutPage;
tab3Root = ContactPage;
constructor(public navCtrl: NavController) {
}
}
在app.module.ts
删除:AboutPage、ContactPage、HomePage、TabsPage on =>> entryComponents
entryComponents: [
MyApp,
],
而且效果很好 ))
我尝试在我的应用程序中推送一个带有选项卡的新页面。但是,我发现当我点击按钮(添加朋友)时,右侧弹出新页面,背景页面突然消失。当我单击新页面(组件)左上角的后退按钮时。你会发现背景层只显示白色,新页面完全关闭后,欢迎页面又出现了。
示例:
你可以在下面看到我的代码:
如果您需要,这里是代码:https://stackblitz.com/edit/ionic-mfc3ga
- open the link in Chrome
- clicking "open in new window" on the top right of the page.
- In new window, open development tools(Chrome) and switch to mobile model(toggle device toolbar) and please refresh the browser.
- clicking the "add friend button" on the top right.
- you will see the background page(Welcome to Ionic) disappearing when the new page slides from right to left.
- In addition, when you click back button on the top left in new page(component). you will find that the background layer only shows white, and after the new page closing completely, the welcome page shows again.
我不知道我的代码有什么问题。
谢谢大家
删除 import { AboutPage } from '../about/about';
到关于页面
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
// import { AboutPage } from '../about/about'; DELETE THIS
import { ContactPage } from '../contact/contact';
import { HomePage } from '../home/home';
@Component({
selector: 'page-about',
templateUrl: 'about.html'
})
export class AboutPage {
tab1Root = HomePage;
// tab2Root = AboutPage;
tab3Root = ContactPage;
constructor(public navCtrl: NavController) {
}
}
在app.module.ts
删除:AboutPage、ContactPage、HomePage、TabsPage on =>> entryComponents
entryComponents: [
MyApp,
],
而且效果很好 ))