ionic 4 custom ion-menu width not working in ios

1k views Asked by At

I have a problem in ionic 4 application custom width in ion-menu is not working in iPhone 5/5s. It's working fine in iPhone 6 and above.

I want custom width 100px for a menu.

app.component.html

<ion-app>
<ion-split-pane>
<ion-menu class="appMainmenu" type="overlay" [swipeGesture]="false">
  <ion-content class="bg-profile">
    <ion-list no-margin>
      <ion-list-header color="dark" margin-bottom style="min-height: 2.9em;">
        <ion-label>Menu</ion-label>
      </ion-list-header>



      <ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">

        <div [routerLink]="[p.url]" class="menuMargin" text-center (click)="openPage(p)"
          [class.activeMenu]="checkActivePage(p)">
          <h4 class="fs-35" no-padding>
            <ion-icon slot="start" [name]="p.icon" color="dark"></ion-icon>
          </h4>
          <h5 class="fs-13" no-padding> {{p.title}} </h5>
        </div>
      </ion-menu-toggle>
      <ion-menu-toggle auto-hide="false">
        <div class="menuMargin" text-center (click)="logout()" [class.activeMenu]="checkActivePage(p)">
          <h4 class="fs-35" no-padding>
            <ion-icon name="power" color="dark"></ion-icon>
          </h4>
          <h5 class="fs-13" no-padding> Logout </h5>
        </div>
        <div ctext-center>
          <h4 class="versioncss" no-padding>V - 1.0.28</h4>
        </div>
      </ion-menu-toggle>
    </ion-list>
  </ion-content>
</ion-menu>
<ion-router-outlet [swipeGesture]="false" main></ion-router-outlet>

global.css

.appMainmenu{
--width: 100px;
width: 100px
}
1

There are 1 answers

0
igor_c On BEST ANSWER

Try to add ion-menu as a selector in css:

ion-menu.appMainmenu {
    --width: 100px;
}