【问题标题】:ionic 3 side menu not working in iosionic 3侧边菜单在ios中不起作用
【发布时间】:2017-10-04 18:54:06
【问题描述】:

我的 ionic 侧边菜单在 android 手机上运行,​​但在 ios 上却没有。

这是 .html 的代码

<button ion-button menuToggle icon-only class="menuButton"> 
  <ion-icon name="menu"></ion-icon>
</button>

<ion-menu [content]="mycontent">
  <ion-content>
    <ion-list>
      <p>some menu content, could be list items</p>
    </ion-list>
  </ion-content>
</ion-menu>

<ion-nav #mycontent ></ion-nav>

我不明白我的问题在哪里如果你需要什么请告诉我

我的侧边菜单在 android 和除 ios 之外的浏览器中运行

【问题讨论】:

    标签: ionic2 ionic3 side-menu


    【解决方案1】:

    尝试将 type="overlay" 添加到侧边菜单:

    <ion-menu [content]="mycontent" type="overlay">
    

    【讨论】:

      【解决方案2】:

      使用点击功能代替 menuToggle

      <button ion-button icon-only start (click)="openSideMenu()">
           <ion-icon name="md-menu"></ion-icon>
      </button>
      

      使用打开菜单

      openSideMenu() {
         this.menuCtrl.enable(true)
          this.menuCtrl.toggle();    
      }
      

      在推送到新页面之前禁用菜单

      this.menuCtrl.enable(false)
      

      【讨论】:

        猜你喜欢
        • 2019-01-04
        • 2017-11-12
        • 1970-01-01
        • 2017-12-25
        • 2018-11-15
        • 2023-03-12
        • 1970-01-01
        • 2014-02-10
        • 2020-03-22
        相关资源
        最近更新 更多