刚下载了xcode 9,我有这个奇怪的问题,在ios 11上,我的自定义导航栏看起来是一半大小并且在状态栏下,在ios 10上工作正常.
所以这是我的代码
let newNavbar: UINavigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 64))
let navItem = UINavigationItem()
//create and assign the items
newNavbar.setItems([navItem], animated: false)
view.addSubview(newNavbar)
Run Code Online (Sandbox Code Playgroud)
这是一个截图,左边是ios11,右边是ios10,