如何将视图放置在 UINavigationController 子类的导航栏顶部?
How can a view be placed on top of the navigation bar of a UINaviagationController subclass?
根视图控制器 HomeTableViewController
嵌入在 UINavigationController
中。一个subView如何占据整个屏幕并放置在CustomNavigation: UINavigationController
class的导航栏顶部?
这是我正在使用的代码:
if var player = self.moviePlayer {
player.view.frame = self.view.bounds
player.prepareToPlay()
player.scalingMode = .AspectFill
player.controlStyle = .None
// self.view.addSubview(player.view)
self.navigationController.view.addSubview(player.view)
}
我看到错误:
'UINavigationController?' does not have a member named 'view'
这是我的 Main.storyboard:
如此简单...
navigationController?.navigationBarHidden = true
根视图控制器 HomeTableViewController
嵌入在 UINavigationController
中。一个subView如何占据整个屏幕并放置在CustomNavigation: UINavigationController
class的导航栏顶部?
这是我正在使用的代码:
if var player = self.moviePlayer {
player.view.frame = self.view.bounds
player.prepareToPlay()
player.scalingMode = .AspectFill
player.controlStyle = .None
// self.view.addSubview(player.view)
self.navigationController.view.addSubview(player.view)
}
我看到错误:
'UINavigationController?' does not have a member named 'view'
这是我的 Main.storyboard:
如此简单...
navigationController?.navigationBarHidden = true