iPhone - How set uinavigationbar height?

后端 未结 9 2310
情歌与酒
情歌与酒 2020-11-28 05:25

I want to make the top of the navigation view a bit smaller. How would you achieve this? This is what I\'ve tried so far, but as you can see, even though I make the navigati

9条回答
  •  借酒劲吻你
    2020-11-28 06:07

    It's not necessary to subclass the UINavigationBar. In Objective-C you can use a category and in Swift you can use an extension.

    extension UINavigationBar {
        public override func sizeThatFits(size: CGSize) -> CGSize {
            return CGSize(width: frame.width, height: 70)
        }
    }
    

提交回复
热议问题