【问题标题】:How to hide the back button inside the bottom Tab Bar Menu in Home Page. - ionic 4如何隐藏主页底部标签栏菜单内的后退按钮。 - 离子 4
【发布时间】:2020-05-07 21:39:10
【问题描述】:

我试图在 ionic 4 中的 tab-home-page.html 中隐藏 Tab-Bar 中的后退按钮。 我试图隐藏后退按钮,但它会为其他页面隐藏它。 我在那里搜索过,但找不到。

有没有办法做到这一点?下面是我的 Tab.page.HTML。希望有人能指导我。

<ion-tabs>
  <ion-tab-bar slot="bottom">

    <ion-tab-button ion-button (click)="goBack()">
       <ion-icon name="arrow-undo-circle-sharp" class="img-size"></ion-icon>
    </ion-tab-button>

    <ion-tab-button tab="tab-home">
      <ion-icon name="home-sharp" class="img-size"></ion-icon>
    </ion-tab-button>

    <ion-tab-button tab="tab-profile">
      <ion-icon name="link-sharp" class="img-size"></ion-icon>
    </ion-tab-button>

  </ion-tab-bar>   
</ion-tabs>

【问题讨论】:

    标签: ionic4


    【解决方案1】:

    ** 编辑 ** 导航回您的主页, 只需将&lt;ion-back-button&gt;&lt;/ion-back-button&gt; 添加到导航页面内的标题

    <ion-header>
      <ion-toolbar>
        <ion-buttons slot="start">
          <ion-back-button></ion-back-button>
        </ion-buttons>
      </ion-toolbar>
    </ion-header>
    

    这将解决您没有为您的后页添加标签按钮的问题。

    【讨论】:

    • 我想你错过了理解我的问题,我的每一页底部都有一个标签栏。我想隐藏主页上的后退按钮。
    • 我能问一下为什么在你的标签栏上使用你的后退按钮吗?你可以在你需要的每个页面的标题中使用
    • 是用户要求有后退按钮,位于页面底部。
    • 你可以在你不需要的页面上设置一个 *ngif 并在相应的按钮上设置一个布尔条件,在你不需要的页面上设置为 false,在你需要的页面上设置为 true,简单的显示和隐藏
    • 你有一些例子可以告诉我如何放置 ngif 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多