Ionic 3: Menutoggle keeps getting hidden

▼魔方 西西 提交于 2019-12-06 06:48:40

问题


I have implemented a hamburgermenu in Ionic 3, but I am facing an issue. When I run the application on my Android device the hamburgermenu keeps disappearing i.e. the button to open the side menu is gone. However, it only happens sometimes. I tried to run the application while inspecting it with Google Chrome, and what I noticed is that the menutoggle gets hidden for some reason, but I don't know why. I don't control the visibility in the .ts class.

<ion-header>
  <div>
    <ion-navbar>
      <button ion-button menuToggle> // this becomes "<button ion-button menuToggle hidden>"
        <ion-icon name="menu"></ion-icon>
      </button>
      <ion-title>Frontpage</ion-title>
    </ion-navbar>
  </div>
</ion-header>

回答1:


I am having similar issue for menu toggle.

I added below code for my page.

Header html code:

<ion-header>
 <ion-navbar text-center color="navBar">
  <ion-buttons right>
   <button class="menu" ion-button menuToggle="right" icon-only>
    <ion-icon name="menu"></ion-icon>
   </button>
  </ion-buttons>
  <ion-title>Password Reset</ion-title>
 </ion-navbar>
</ion-header>

Header css code:

.menu {
    display: block !important;
}


来源:https://stackoverflow.com/questions/50068182/ionic-3-menutoggle-keeps-getting-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!