One behavior I observed in iOS 7 is that the title of the backBarButtonItem
of a UINavigationItem
get's renamed if the title of the currently displayed view controller is too long. Too lazy to explain so here are some photos:
As you can see, when the title is too long, the back button gets renamed to "Back" regardless of what it was previously. If the title is even longer, the back button doesn't show any text, just the left arrow image.
Does anyone know how to disable this behavior? I would like the back button to stay exactly what I want it to be and not get renamed. Thanks
EDIT
I created a dirty solution by manually constraining the width of the title of the view controller. I discovered that the font of the title on iPhone is System Bold 17.0, so I do a check for what the size the title will be before setting it (via the sizeWithAttributes:
method of strings), and trim characters off the end of the title until the size is shorter than the length that causes the back button to get renamed.