android - Ionic2 导航栏在 android 中左右带有图标

标签 android css angular ionic2

<ion-header>
    <ion-navbar align-title="center" color="primary" hideBackButton>
        <ion-buttons ion-button icon-only start class="card-buttons">
            <button class="card-buttons" (tap)="openMenu()">
                <ion-icon name="menu"></ion-icon>
            </button>
        </ion-buttons>
        
        <ion-title class="card-title">        
            {{title | translate}}
        </ion-title>
        <ion-buttons  ion-button icon-only end>
            <button ion-button (tap)="goBack()">
                <ion-icon name="md-arrow-round-back"></ion-icon>
            </button>
            <button ion-button (tap)="share()">
                <ion-icon name="share" class="ion-md-share"></ion-icon>
            </button>
        </ion-buttons>
    </ion-navbar>
</ion-header>

菜单图标应显示在左侧,但显示在右侧。在 iOS 上没问题。在android中是这个问题: enter image description here

谁能帮忙?

谢谢

最佳答案

这是为 android 和 windows 设计的。

检查这个github issue

start places it to the left of the title in ios and to the right of the title in md and wp mode. If you'd like a button to always be on the left, regardless of the mode, use the left property instead.

尝试:

<ion-header>
    <ion-navbar align-title="center" color="primary" hideBackButton>
        <ion-buttons icon-only left class="card-buttons">
            <button ion-button class="card-buttons" (tap)="openMenu()">
                <ion-icon name="menu"></ion-icon>
            </button>
        </ion-buttons>

        <ion-title class="card-title">        
            {{title | translate}}
        </ion-title>
        <ion-buttons icon-only right>
            <button ion-button (tap)="goBack()">
                <ion-icon name="md-arrow-round-back"></ion-icon>
            </button>
            <button ion-button (tap)="share()">
                <ion-icon name="share" class="ion-md-share"></ion-icon>
            </button>
        </ion-buttons>
    </ion-navbar>
</ion-header>

同时检查 here

关于android - Ionic2 导航栏在 android 中左右带有图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43843487/

相关文章:

java - 如何从uid Firebase数据库获取电子邮件地址?

javascript - PhoneGap ondeviceready 5 秒后未触发

javascript - 告诉谷歌不要索引网站的某些部分

html - 如何更改 "Browse"按钮文本

angular - 相当于 Angular 中 APP_INITIALIZER 的模块

html - ionic 2 : Dismiss loading animation when iframe is ready

Android View 绑定(bind) - 多模块项目中 Unresolved 引用

android - 如何启动多个 FlutterActivity?

html - Translate3d 父级覆盖位置 : absolute child

angular - 如何在 Angular Material 2 中构建自定义组件