objective-c - 为什么 UIViewController 在旋转时不填充窗口,而 UINavigationController 却填充窗口?

标签 objective-c ios uiviewcontroller uinavigationcontroller autorotate

我刚刚注意到,当 UIViewController 是窗口上的根 Controller 时,自动旋转会在窗口旋转时渗出一些窗口。

UIViewController as root controller

但是,当您使用 UINavigationController 作为根 Controller 时,情况并非如此。 UINavigationController 做了什么不同的事情来避免渗透?

UINavigationController as root controller

最佳答案

我的猜测(不幸的是我目前没有一个好的 Xcode 来测试),它与 UIViewController 的 wantsFullScreenLayout 属性有关。我怀疑 UINavigationController 返回 YES,而默认 VC 返回 NO

关于objective-c - 为什么 UIViewController 在旋转时不填充窗口,而 UINavigationController 却填充窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11803999/

相关文章:

iphone - 单击注释时如何将数据传递给它的 View Controller ?

iphone - 可执行加密检查防盗版措施

ios - 如果在上下文的线程上运行,[NSManagedObjectContext PerformBlock] 是否同步?

swift - 如何在 Playgrounds 中设置 ViewController?

ios - 即使启用了自动布局,我也可以以编程方式设置特定 View 的框架吗?

ios - 在 iOS 锁定屏幕上使用播放器控件进行远程控制应用程序

objective-c - 核心数据删除规则

objective-c - Obj-C __block 变量保留行为

ios - 除了使用初始化程序之外,如何在 10 秒后停止 NSURLRequest 超时?

javascript - Socket.io 浏览器客户端未接收来自 socket.io 客户端的发出事件