【发布时间】:2015-05-05 00:06:21
【问题描述】:
我有一个UINavigationController 和一个UIViewController 作为它的根视图控制器。
let rootVC = Page1ViewController() // extends UIViewController
let nav = UINavigationController(rootViewController: rootVC)
presentViewController(nav, animated: true) { () -> Void in
}
问题是rootVC的内容出现在导航栏下。我试过了:
nav.navigationBar.translucent = false
这可行,但我希望导航栏是透明的,并且我希望 rootVC 的内容不会出现在导航栏后面。
我也试过了:
nav.edgesForExtendedLayout = UIRectEdge.None
但这不会改变任何事情。
如何获得一个透明的导航栏,滚动时内容在其下方滚动,但加载内容时不应出现在导航栏下方?
【问题讨论】:
标签: ios objective-c swift uiviewcontroller