ios - 在 iOS 设备上运行时,Ionic bar-header 未居中
<p><p>我正在使用 Ionic 构建适用于 Android 和 iOS 的应用。<br/>
我在 View 中使用 <code>bar-header</code> 作为标题:</p>
<pre><code><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>
</code></pre>
<p>当使用 <code>ionic serve -l</code> 在我的浏览器中显示时,标题正确显示:</p>
<p> <a href="/image/p7oKi.png" rel="noreferrer noopener nofollow"><img src="/image/p7oKi.png" alt="ionic lab display"/></a> </p>
<p>在真正的 Android 设备上运行时,它也能正常工作:
<a href="/image/nyv8T.png" rel="noreferrer noopener nofollow"><img src="/image/nyv8T.png" alt="run on Android"/></a>
但是当我在 iOS 设备(物理设备或模拟器)上运行应用程序时,标题不是垂直居中的:</p>
<p> <a href="/image/S7wHr.jpg" rel="noreferrer noopener nofollow"><img src="/image/S7wHr.jpg" alt="run on iPhone"/></a>
我尝试添加 CSS 以明确指定 <code>vertical-align</code> 或 <code>text-align</code>,但没有成功。</p>
<h2>什么可以解释这个问题?我怎样才能在这个标题中居中标题?</h2></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>这种问题很常见,具体取决于您使用的 Ios/Ionic 版本,
您是否尝试使用标签?
<a href="http://ionicframework.com/docs/api/directive/ionHeaderBar/" rel="noreferrer noopener nofollow">ion-header-bar</a> </p></p>
<p style="font-size: 20px;">关于ios - 在 iOS 设备上运行时,Ionic bar-header 未居中,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/37862015/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/37862015/
</a>
</p>
页:
[1]