【问题标题】:Ionic bar-header not centered when running on iOS device在 iOS 设备上运行时,Ionic bar-header 未居中
【发布时间】:2016-10-18 03:18:04
【问题描述】:

我正在使用 Ionic 构建适用于 Android 和 iOS 的应用。
我在我的视图中使用bar-header 作为标题:

<ion-view view-title="Home" class="tab-home">
    <ion-content class="padding">
        <div class="bar bar-header bar-positive">
            <div class="h1 title">The European Experience</div>
        </div>
        <div class="bar bar-subheader bar-stable">
            <h2 class="title">Companion App</h2>
        </div>
        <div class="content has-header padding">
            ...
        </div>
    </ion-content>
</ion-view>

当在我的浏览器中显示 ionic serve -l 时,标题正确显示:

在真正的 Android 设备上运行时,它也能正常工作: 但是当我在 iOS 设备(物理设备或模拟器)上运行应用程序时,标题不是垂直居中的:

我尝试添加 CSS 以明确指定 vertical-aligntext-align,但没有成功。

什么可以解释这个问题?我怎样才能在这个标题中居中标题?

【问题讨论】:

    标签: ios iphone ionic-framework vertical-alignment text-alignment


    【解决方案1】:

    这种问题很常见,具体取决于您使用的 Ios / Ionic 版本, 您是否尝试使用标签? ion-header-bar

    【讨论】:

    • 我没试过,我会告诉你它是否有助于解决这个问题!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 2018-06-22
    • 1970-01-01
    • 2018-08-20
    • 1970-01-01
    • 2015-07-31
    相关资源
    最近更新 更多