首页 > 解决方案 > 如何在 iOS 中更改导航栏的高度

问题描述

我想设置将从网络服务接收到的导航栏的高度

标签: iosswiftuinavigationbar

解决方案


我在顶部添加了自定义视图而不是导航栏并隐藏了默认导航栏。然后设置该视图的高度并采取height约束措施。

@IBOutlet weak var const_customNavBar_height : NSLayoutConstraint!

更改如下:

self.const_customNavBar_height.constant = 105

替换105为 Web 服务中收到的高度。


推荐阅读