OStack程序员社区-中国程序员成长平台

标题: ios - 在 iOS 设备上运行时,Ionic bar-header 未居中 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 16:45
标题: ios - 在 iOS 设备上运行时,Ionic bar-header 未居中

我正在使用 Ionic 构建适用于 Android 和 iOS 的应用。
我在 View 中使用 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 在我的浏览器中显示时,标题正确显示:

ionic lab display

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

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

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



Best Answer-推荐答案


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

关于ios - 在 iOS 设备上运行时,Ionic bar-header 未居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37862015/






欢迎光临 OStack程序员社区-中国程序员成长平台 (http://ostack.cn/) Powered by Discuz! X3.4