iOS11 customize navigation bar height

前端 未结 2 866
温柔的废话
温柔的废话 2020-12-28 18:53

First of all, thank you for coming here and help solving my problem. Thank you!!!

In iOS11 beta6, sizeThatFits: seems to not work on UINavigationBar. I

2条回答
  •  余生分开走
    2020-12-28 19:20

    Since iOS 11 UINavigationBar fully supports Auto Layout (this is the reason why you're seeing its constraints). I've opened a radar to Apple because I thought that setting a height constraint to the titleView would have adjusted the navigation bar height accordingly. However this is what Apple replied:

    Full support for auto layout does not imply that your view can influence other aspects of the layout of the navigation bar – in particular, the navigation bar enforces its own height and does not allow the title view or other custom views to exceed the height of the navigation bar. We are continuing to work on this issue, and will follow up with you again.

    As of today the radar is still open.

提交回复
热议问题