您好如何在ionic2中显示侧面菜单而不是后退按钮...
这是我的代码我想在此视图中显示侧边菜单...
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Myrepeat</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
Testing Page
</ion-content>
我的myrepeat.ts
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import {Observable} from 'rxjs/Rx';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
@Component({
templateUrl: 'myrepeat.html'
})
export class Myrepeat {
constructor (private http: Http) {}
}
答案 0 :(得分:1)
要避开后退按钮,您必须使用setRoot
请看一下这个navControll你必须使用这样的this.navCtrl.setRoot('PageName',{});