当我按屏幕离子3时菜单不起作用 [英] Menu is not working when i push the screen ionic 3

查看:104
本文介绍了当我按屏幕离子3时菜单不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个屏幕登录,主页附带菜单,4个标签。喜欢 home,about,location,more 。在这种情况下,菜单工作正常。当我登录时,我使用下面的代码导航屏幕到所有选项卡,菜单的主页。那个时候工作正常。

I have one screen login with home comes with menu, 4 tabs . Like home, about, location, more.And in this case menu working fine. When i login, i use this below code to navigate the screen to home pagewith all tabs , menu. That time its working fine.

 this.navCtrl.push(TabsPage);

当我在关于屏幕时。我有一个按钮来显示一些数据,当用户按下确定按钮时,它会显示一个带有一些分数数据的屏幕:

And when i am in about screen . I have one button to show some data and when user press ok button it will show one screen with some score data:

这是屏幕代码:

<ion-header>
  <ion-navbar color="navcolr" no-border-bottom>
    <ion-title >Exam Score</ion-title>
  </ion-navbar>
</ion-header>
<ion-content padding fullscreen>

      <ion-card style="width: 91%;">

      <div style="font-size: 20px;text-align: center;">
        <span>Your Score : {{this.correctans}}</span>
      </div>

      </ion-card>

      <button ion-button style="width: 152px !important;margin-left: 23%;" (click)="cancelBtn()">CANCEL</button>

</ion-content>

以上屏幕将是 modalCtrl 。所以上面你可以看到取消但是知道。一旦我按下它就会进入点击页面。

This above screen will be a modalCtrl . So above you can see cancelbuton know. Once i press that it will go to taps pages.

这里代码:

cancelBtn() {
   //this.navCtrl.setRoot(TabsPage);
   this.navCtrl.push(TabsPage);
}

所以它进入我的主页,显示所有菜单图标,点击图标..但是标签正在发挥作用。

So its going to my home page with all menu icon, tap icon... But tabs are working.

我尝试使用解除viewcontroller 但它只解除了视图,所以仍然在我的问题页面.....但我需要去我的 tabspage ...我怎么能这样做? / p>

I tried with dismiss viewcontrollerBut its dismiss only the view , so that still in my question page.....but i need to go to my tabspage...How can i do this ?

推荐答案

在模态页面中

import {ViewController} from 'ionic-angular';

...

 constructor(
    private view: ViewController
 ) {}

...

closeModal() { //handler to close modal.
    this.view.dismiss();
}

这篇关于当我按屏幕离子3时菜单不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆