1
私はイオン2に隠そうとしています。私は<ion-navbar [hidden]="true">
を試しましたが、動作しません。Ionic2でnavbarを非表示にする方法
誰でもionic2の条件付きでnavbarを非表示にする方法を教えてもらえますか?
私はイオン2に隠そうとしています。私は<ion-navbar [hidden]="true">
を試しましたが、動作しません。Ionic2でnavbarを非表示にする方法
誰でもionic2の条件付きでnavbarを非表示にする方法を教えてもらえますか?
あなたはそれ
<ion-navbar *ngIf="showNavbar">
そして、あなたのコンポーネントのコードで表示/非表示するためにあなたのコンポーネントからプロパティを使用できます。
import { Component, ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild(Content) content: Content;
public showNavbar: boolean;
// ...
public hideNavbar(): void {
this.showNavbar = false;
// You should resize the content to use the space left by the navbar
this.content.resize();
}
}
ビンゴ。ありがとうございました。 – raju
喜んで:) – sebaferreras