Programmatically get height of navigation bar

前端 未结 14 1130
猫巷女王i
猫巷女王i 2020-12-04 08:02

I know that the presence of the more view controller (navigation bar) pushes down the UIView by its height. I also know that this height = 44px. I have also discovered tha

14条回答
  •  不思量自难忘°
    2020-12-04 08:40

    I have used:

    let originY: CGFloat = self.navigationController!.navigationBar.frame.maxY
    

    Working great if you want to get the navigation bar height AND its Y origin.

提交回复
热议问题