无法更改导航栏的高度iOS 11 [英] Cant change navigation bar height ios 11
本文介绍了无法更改导航栏的高度iOS 11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法在ios 11中更改导航栏框架.这是我的ios 10代码示例:
I cant change navigation bar frame in ios 11. Here is sample of my code for ios 10:
if let navigationBar = self.navigationController?.navigationBar {
let frame = CGRect(x: navigationBar.frame.origin.x,
y: navigationBar.frame.origin.y,
width: navigationBar.frame.width,
height: navigationBar.frame.height + 100)
navigationBar.frame = frame
}
分别为ios 10和ios 11的屏幕截图
ios 10 and ios 11 screenshots respectively
推荐答案
在iOS 11中不再直接支持更改UINavigationBar的高度(请参见此处,此处&
Changing the height of the UINavigationBar is no longer directly supported in iOS 11 (see here, here & here).
您最好的期望是做一些事情,例如在导航栏后面查看并删除边框(请参见
The best you can hope for is to do something like having a view behind the navigation bar and removing the borders (see here for customisation examples).
这篇关于无法更改导航栏的高度iOS 11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文