IONIC:需要将 side-menu 设置为应用程序的右侧 header

IONIC : Need to set a side-menu to Right side of the application header

我在 header 菜单上有两个菜单。左侧 "Burger Menu" 和带有 "add" 符号的右侧菜单。两个菜单的 html 内容包含在单独的 side-menu.html 中 [不在 app.html] 左侧菜单的 ID 为 "menuLeft",右侧菜单的 ID 为 "menuRight"

Burger 菜单出现在主页上,在进入 child 菜单后,它被 BACK 按钮取代。这是意料之中的事情,我对此很满意。

所有页面均未启用右侧菜单。我仅将以下代码包含在需要显示正确菜单的 child 菜单 html 文件中。

<ion-navbar>
    <ion-title>{{name}}</ion-title>
    <button ion-button end>
        <ion-icon name="add"></ion-icon>
      </button>
</ion-navbar>

在其对应的 *.ts 文件中,我在 ionViewWillEnter 中启用了右键菜单

ionViewWillEnter() {
    this.menu.enable(true, 'menuRight');
  }

现在,我有两个问题。 1. 当我在按钮标签中包含 menuToggle 时,菜单消失了。但我想要菜单出现,我应该有菜单切换功能

  1. 只有当 menuToggle 属性不是 mentioned.And 时,我才能使右侧菜单出现,它没有出现在 header 的右端,它只是出现在标题之前。请参阅随附的屏幕截图。

  2. 不知道为什么我得到 "add" 按钮的背景。我可以让它透明吗?

如果您需要更多信息,请告诉我。提前致谢

更改您的导航栏,使菜单显示在右侧,我需要更多信息来回答其他问题。您将菜单 Toggle 放在哪里?

<ion-navbar>
  <ion-title>{{name}}</ion-title>
  <ion-buttons right>
    <button ion-button>
      <ion-icon name="add"></ion-icon>
    </button>
  </ion-buttons>
</ion-navbar>