ion-nav-bar ng-class没有样式

时间:2022-09-10 12:09:16
<ion-nav-bar ng-class="{'bar-positive': isAndroid, 'bar-stable': !isAndroid}">
</ion-nav-bar>

<ion-tabs ng-class="{'tabs-positive': isAndroid, 'tabs-icon-top': true}">

  <!-- Account Tab -->
  <ion-tab title="Account" icon="ion-ios7-gear" href="#/tab/account">
    <ion-nav-view name="tab-account"></ion-nav-view>
  </ion-tab>

</ion-tabs>

When I use the following markup, only the ion-tabs is styled - not the ion-nav-bar. How can I get them both to be styled, and why isn't the ion-nav-bar getting styled?

当我使用以下标记时,只有离子选项卡被样式化——而不是离子导航条。我怎么才能让它们都有样式,为什么离子导航条没有样式?

1 个解决方案

#1


5  

Ok, never mind. There's an issue for this on github. Also, I've found a somewhat convoluted workaround that should be fine until they fix the ion-nav-bar directive:

好吧,没关系。github上有个问题。此外,我还发现了一个有点复杂的解决方案,在修正离子导航条指令之前应该没问题:

<ion-nav-bar class="{{ isAndroid ? 'bar-positive' : 'bar-stable' }}">
  <ion-nav-back-button>
  </ion-nav-back-button>
</ion-nav-bar>

#1


5  

Ok, never mind. There's an issue for this on github. Also, I've found a somewhat convoluted workaround that should be fine until they fix the ion-nav-bar directive:

好吧,没关系。github上有个问题。此外,我还发现了一个有点复杂的解决方案,在修正离子导航条指令之前应该没问题:

<ion-nav-bar class="{{ isAndroid ? 'bar-positive' : 'bar-stable' }}">
  <ion-nav-back-button>
  </ion-nav-back-button>
</ion-nav-bar>