Search code examples
iosuinavigationbarframeuinavigationitemtitlebar

Get max width of uinavigationItem.titleView?


I have a custom titleView that I need to set the max width for. That would be the screen width - width of left item (back title, button or nil) - width of right item (button or nil). How can I determine this?

Thanks.


Solution

  • Doesn't the navigationbar set the width to its maximum automatically? I mean, I'm sure the sizeThatFits: method of your custom titleView is called. Maybe this is a good starting point.