ios - 扩展界面构建状态栏下的导航栏
<p><p>导航栏在模拟器上运行时呈现应有的效果,因为我正在实现委托(delegate)方法。</p>
<pre><code>extension AboutViewController: UINavigationBarDelegate {
func positionForBar(bar: UIBarPositioning) -> UIBarPosition {
return .TopAttached
}
}
</code></pre>
<p>但我希望它在界面生成器中呈现时看起来相同。我该怎么做?</p>
<p> <a href="/image/6Xwro.png" rel="noreferrer noopener nofollow"><img src="/image/6Xwro.png" alt="enter image description here"/></a> </p>
<p> <a href="/image/lEUkp.png" rel="noreferrer noopener nofollow"><img src="/image/lEUkp.png" alt="enter image description here"/></a> </p>
<h2>编辑</h2>
<p>这是编辑器菜单,那里没有 pin 选项。</p>
<p> <a href="/image/rAYBT.png" rel="noreferrer noopener nofollow"><img src="/image/rAYBT.png" alt="enter image description here"/></a> </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>不要将顶部约束添加到<code>Top Layout Guide</code>,而是在Interface Builder中选择导航栏并转到<code>Editor > Pin > Top Space to Superview</code>。</p>
<p>突然在 Xcode 7 中没有 <code>Pin</code> 菜单。所以尝试这样做(见屏幕截图)。</p>
<p> <a href="/image/9tVdp.png" rel="noreferrer noopener nofollow"><img src="/image/9tVdp.png" alt="enter image description here"/></a> </p></p>
<p style="font-size: 20px;">关于ios - 扩展界面构建状态栏下的导航栏,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/31919052/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/31919052/
</a>
</p>
页:
[1]