分层的UIViewControllers重叠状态栏 [英] Layered UIViewControllers overlaps status bar

查看:167
本文介绍了分层的UIViewControllers重叠状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照。


Following this tutorial and this question, I attempted to create a custom UIViewController containing a UINavigationController. This mostly worked, except that the controller takes up the full screen and so the status bar overlaps it. Downloading the tutorial's source and running it, I found that the tutorial had the same problem (it uses a UITableViewController). Further experimentation revealed that it works if the content of the custom controller is a UILabelView instead.

解决方案

One possible solution is to change the loadView function of the UIViewController to set the frame of the view using: [[UIScreen mainScreen] applicationFrame] instead of contentView.frame. I'm not sure whether this is the best solution and how this will interact if you attempt to put the custom view controller underneath another view controller.

Ideally, I would be be given the size I have to draw into inside the loadView method. Unfortunately, we aren't given this. See this question for more info.

这篇关于分层的UIViewControllers重叠状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆