Prevent UiNavigationBar Title from getting Cut off?
I am trying to customize the appearance of the navigationBar title in my
ios application. This is the code I currently have:
NSMutableDictionary *navigationTitleAttributes = [NSMutableDictionary
dictionary];
[navigationTitleAttributes setValue:[UIColor whiteColor]
forKey:UITextAttributeTextColor];
[navigationTitleAttributes setValue:[UIColor clearColor]
forKey:UITextAttributeTextShadowColor];
[navigationTitleAttributes setValue:[NSValue
valueWithUIOffset:UIOffsetMake(0.0, 0.0)]
forKey:UITextAttributeTextShadowOffset];
[navigationTitleAttributes setValue:[UIFont fontWithName:@"Calibri"
size:30] forKey:UITextAttributeFont];
[[UINavigationBar appearance]
setTitleTextAttributes:navigationTitleAttributes];
[[UINavigationBar appearance] setTitleVerticalPositionAdjustment:-8
forBarMetrics:UIBarMetricsDefault];
The code yields the following effect:
It works great but my title gets cut off from the bottom.
I've seen solutions to this problem that use a custom UIView (such as this
one: UINavigationbar title is cut off when using titleTextAttributes).
However, that particular solution requires that the titleView property of
the navigation bar be updated for each screen.
I was wondering if there was a simple solution that would cascade through
my entire application.
Thanks
No comments:
Post a Comment