iPhone - How set uinavigationbar height?

后端 未结 9 2333
情歌与酒
情歌与酒 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:22

    For swift

    create a subclass of Uinavigation bar.

    import UIKit
    
    class higherNavBar: UINavigationBar {
    
    override func sizeThatFits(size: CGSize) -> CGSize {
        var newSize:CGSize = CGSizeMake(self.frame.size.width, 87)
        return newSize
    }
    

    There will be two blank strips on both sides, I changed the width to the exact number to make it work.

    However the title and back button are aligned to the bottom.

提交回复
热议问题