iOS Navbar 以小尺寸而不是大尺寸的 iOS 11 风格开始 [英] iOS Navbar starts as a small instead of large iOS 11 style
问题描述
当我启动我的应用程序时,我的导航栏会自动作为一个小导航栏启动,但我在我的代码中指定使用大导航栏:navigationController?.navigationBar.prefersLargeTitles = true
,我是在同一个 ViewController 中使用 collectionView.
When I launch my app, my Navbar automatically starts as a small one, but I have specified in my code to use large navigation bars: navigationController?.navigationBar.prefersLargeTitles = true
, I'm using a collectionView in the same ViewController.
每次启动我的应用程序时,我都必须向下滚动才能显示 iOS 11 风格的导航栏.什么可能导致此问题?
Every time I launch my app I have to scroll down to get the iOS 11 style Navbar to appear. What could cause this problem?
当我启动我的应用程序时的结果:
Result when I launch my app:
向下滑动时的结果以及应用程序最初启动时的外观
Result when I slide down and what it should look like when the app initially launches
故事板
推荐答案
在 Storyboard 中,选择导航栏,然后在属性选择器中选择以下选项:
In your Storyboard, select the navbar, and in the attributes selector choose the following option:
这篇关于iOS Navbar 以小尺寸而不是大尺寸的 iOS 11 风格开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!