【发布时间】:2017-08-14 09:01:35
【问题描述】:
在我的UINavigationBar 子类中,我添加了一个带有insertSubview(customView, at: 0) 的子视图,以便将它放在UINavigationBar 的“后面”。
在 iOS 10 中,添加的 subView 将根据我的需要添加 Title 和 UIBarButtonItems,但在 iOS 11 中,Apple 似乎改变了一些东西,因为无论我尝试什么,customView 都会被放置在UINavigationBar的前面。
//containerView
containerView.frame = CGRect(x: 0, y: -(statusBarHeight), width: UIScreen.main.bounds.width, height: frame.height + statusBarHeight)
containerView.clipsToBounds = true
insertSubview(containerView, at: 0)
我已经尝试过更改索引。
知道我应该如何解决这个问题吗?
【问题讨论】:
-
我添加了代码
-
遇到同样的问题 iOS 11 beta 9
标签: swift xcode uinavigationbar ios11