I have changed the font of the UINavigationBar using ‘appearance’ available in iOS5. But when doing a push transition to another view controller (using Storyboard) it goes wrong.
During the transition, normally you can see ‘fade in’ the next UIViewController‘s title, but now all I see is ‘F…’ and only at the end of the transition the whole title shows up: ‘Facebook sharing’ (instead of immediately).
Anyone who has had this problem before? This doesn’t happen when there’s a UIBarButton on the right of the UINavigationBar. Then everything goes fine.
I set the font like this:
UIFont *fontName = [UIFont fontWithName:@"Chalkduster" size:0];
NSDictionary *font = [NSDictionary dictionaryWithObjectsAndKeys:fontName, UITextAttributeFont, nil];
[[UINavigationBar appearance] setTitleTextAttributes:font];
The problem got away using a fixed font size instead of ‘0’:
Now it works like a charm. The app will only be running in portrait orientation, otherwise I guess the font size should be set every time the device rotates.