Using the iOS 5 SDK I'm writing an app that uses a custom, script style font in its UINavigationBar instance. The problem with this font is that, since it is in the script style, its glyphs exceed the bounds. You can see the problem in-app here:
For a clearer example, you can see my photoshop document here:
Any idea how I might fix this issue? My first instinct was to set the clipsToBounds property of the UILabel in the UINavigationBar, but there is apparently no apple-approved way to access this object directly. This has plagued me for some time while I was using iOS 5 in beta, so maybe you can help now that the NDA has lifted.
Thanks!
You could use UINavigationItem
's titleView
to set a UILabel
with a custom font, and then override setTitle:
to update your custom label. If necessary, you could then call sizeToFit
on the label or manually update its frame after using sizeWithFont:
or any of the other NSString
sizing methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With