I am in process of adding large title in navigation bar in one of the application. The issue is title is little long so I will require to add two lines in large title. How can I add large title with two lines in navigation bar ?
This is not about default navigation bar title ! This is about large title which is introduced in iOS 11 . So make sure you add suggestions by considering large title. Thanks
To set a multi-line large title in the Navigation Bar, do the following:
Step 1: Add your title to the Navigation Bar via the StoryBoard.
Step 2: Go to your ViewController file and add the following line under viewDidLoad() method
Here you can add a multiline
UILabel
in theNavigationTitle
, You can do it by some kind of customisation in your code and put theUILabel
onself.navigationItem.titleView
Cheers have a good day.
Get a navigation item subviews and locate UILabel from it.
Try this and see:
Here is result:
Based in @krunal answer, this is working for me:
In the UIViewController:
And for setting font and color on the large title: