簡體   English   中英

將離子菜單圖標放在標題的右側

[英]Place ion-menu icon to the right side of the header

我目前正在使用 ionic 側邊菜單模板,它對我來說工作正常,我使側邊菜單從右側滑動,這對我來說也是一件好事,但問題是,菜單圖標位於左側盡管菜單是從右側推動的,但足夠側面。 是否有任何解決方案可以將圖標也放在標題的右側?

<ion-menu [content]="content" type="reveal" side="right" menuToggle="right" >
  <ion-header>
    <ion-toolbar>
      <ion-title>Menu</ion-title>
    </ion-toolbar>
  </ion-header>

  <ion-content>
    <ion-list>
      <button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
        {{p.title}}
      </button>
    </ion-list>
  </ion-content>

</ion-menu>

<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

在要顯示菜單的頁面中,您可以在按鈕標簽中放置“結束”,它會將您的菜單放置在右側。

<ion-header>
  <ion-navbar>
    <button ion-button menuToggle end>
      <ion-icon name="menu"></ion-icon>
    </button>
  </ion-navbar>
</ion-header>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM