如何强制Ionic在每个页面上只显示菜单图标?

时间:2016-03-23 13:09:20

标签: angularjs ionic-framework

如何强制Ionic仅显示菜单图标? 在Android中,我只想显示每个页面的菜单图标。但是,在IOS中,我想要标准导航(即内页的后退按钮)。 有可能吗?

感谢任何帮助。

修改

Menu.html

<ion-side-menus enable-menu-with-back-views="isAndroid">
    <ion-side-menu-content >
        <ion-nav-bar class="bar-stable">
            <ion-nav-back-button></ion-nav-back-button>
            <ion-nav-buttons side="left">
                <button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button>
            </ion-nav-buttons>
        </ion-nav-bar>
        <ion-nav-view name="featureContent"></ion-nav-view>
    </ion-side-menu-content>
    <ion-side-menu side="left">
        <ion-content>
           ...
        </ion-content>
    </ion-side-menu>
</ion-side-menus>

Home.html中

<ion-view hide-back-button="isAndroid">
    <ion-content class="home">
        ...
    </ion-content>
</ion-view>

1 个答案:

答案 0 :(得分:0)

你可以使用ionic.Platform:

$scope.isIOS = ionic.Platform.isIOS();

例如:

<ion-nav-bar class="homler-nav-bar-with-tabs transparent opposite-direction">
    <ion-nav-back-button ng-show="isIOS" class="button-icon icon-top_button_back light">
    </ion-nav-back-button>
     <ion-nav-buttons side="left">
       <button ng-if="isIOS" class="button button-icon button-clear ion-navicon" menu-toggle="left"></button>
       <button ng-if="!isIOS" style="display: block" class="button button-icon button-clear ion-navicon" menu-toggle="left"></button>
     </ion-nav-buttons>