How to make system UINavigationBar bigger and make it last on 2 lines

32 Views Asked by At

I am trying to configure system navigation bar: set new font, make font bold and bigger, and what's most important to make it last on 2 lines. While I can achieve first 2 points, I can't achieve last one - to make it last for 2 lines.

Method that I use now is following: I create UIBarButtonItem for back button, for title and for additional right items if needed. For title UIBarButtonItem custom view I use label, where I set numberOfLines property to zero, which as I thought can help me to make label to last on 2 or more lines. So, that's not working and I am wondering why I have this behaviour? What can I do to make UINavigationBar bigger to fit 2 lines label?

I found out there is init for UINavigationController, which accepts custom UINavigationBar class for UINavigationController (https://developer.apple.com/documentation/uikit/uinavigationcontroller/1621866-init), but unfortunately I can't understand how to configure it, because even with custom subclass I had same results.

I also tried to make subclass of UINavigationController, hide system navigation bar and just place custom view over all controllers, but I have a lot of problems with that solution and also I lost "out of the box" system animations on interactive pop gesture, which is critical for me, because its very time consuming to reproduce

0

There are 0 best solutions below