【问题标题】:Tabs page transparent with back ground image带有背景图像的透明标签页
【发布时间】:2019-09-22 10:29:59
【问题描述】:

我有标签页应用程序。我有这样的背景图片。我怎样才能有如下所示的透明标签?

home.html

<ion-content class="content" fullscreen>


  <ion-grid>
    <ion-row class="ion-margin-top row1">
      <ion-col size="12" class="ion-text-center">

      </ion-col>
    </ion-row>

    <ion-row class="ion-margin-top row2">
      <ion-col size="6" *ngFor="let b of buttons;" class="padding">
        <app-home-root [data]="b"></app-home-root>
      </ion-col>
    </ion-row>

  </ion-grid>
</ion-content>

home.scss

ion-content {
    --background: url('/assets/img/stella/background/background.png') no-repeat 100% 100%;
}

tabs.page.html

<ion-tabs>
  <ion-tab-bar class="tab" slot="bottom" translucent="true">
    <ion-tab-button (click)="profileAction()">
      <ion-img [src]="myProfileSrc"></ion-img>
      <ion-label>
        My Profile
      </ion-label>
    </ion-tab-button>


    <ion-tab-button (click)="openBooking()">
      <ion-img [src]="bookNowSrc"></ion-img>
      <ion-label>Book Now</ion-label>
    </ion-tab-button>
  </ion-tab-bar>
</ion-tabs>

这就是我现在拥有的translucent="true"

【问题讨论】:

    标签: html css angular typescript ionic4


    【解决方案1】:

    Ion-content 不会在选项卡下继续(这可以在您在浏览器中运行时检查它时看到),因此使选项卡透明只会显示应用程序的背景颜色。我不知道是否有可能让它变得透明,但因为它没有区别,你总是可以只为ion-tabs 应用背景颜色(与你的ion-content 相同的颜色)。

    编辑:

    如果你也想去掉边框,这就足够了:

    ion-tab-bar {
        --background: #FFF;
        border-style: none;
    }
    

    如果您仍然看到边框,您可以随时添加border: 0;

    【讨论】:

    • 是的,但是您知道如何删除该边框吗? no-border 没用?
    猜你喜欢
    • 2019-12-13
    • 2011-08-06
    • 2015-11-12
    • 1970-01-01
    • 1970-01-01
    • 2012-05-26
    • 2012-10-15
    • 2014-04-30
    • 2014-08-12
    相关资源
    最近更新 更多