user4951
user4951

Reputation: 33138

How to adjust the font size of the UINavigationBar so that it fits the size of the titleView?

I like to use the default size of UINavigationBar.

However, sometimes the title is too long and I want the font size to get reduced appropiately.

How would I do so?

I suppose, first I need to find out the size of the titleView first. I think that can be done.

Then I need to call a function that will tell me the appropriate font size.

Then I would need to specify the font with that size WITHOUT changing the font name for that UINavigationBar.

Anyone knows how to do any of those (doesn't need to be all).

Upvotes: 0

Views: 263

Answers (1)

Robin
Robin

Reputation: 10011

You need to set the titleTextAttributes property of the UINavigationBar. You can get the font size and font type from the same property and adjust or change the font size and font type depending on ur requirement.

Check out the documentation for more details on the same.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html

Upvotes: 1

Related Questions