【发布时间】:2015-05-07 10:12:50
【问题描述】:
我创建了一个 UINavigationController 和一个 UIViewController。使用此设置,视图如下所示:
这就是我想要的。内容“测试文本”不会出现在状态栏后面。
现在我在 UIViewControllers 中创建了自己的 UINavigationBar:
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.setNavigationBarHidden(true, animated: false)
let newNavBar:UINavigationBar = UINavigationBar(frame: CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 64))
newNavBar.tintColor = UIColor.whiteColor()
newNavBar.translucent = true
self.view.addSubview(newNavBar)
}
结果如下:
内容位于新导航栏的后面。
如何防止内容出现在新导航栏后面?
【问题讨论】:
标签: ios objective-c swift uinavigationcontroller uinavigationbar