One of the actions that I observed in iOS 7 is that the header backBarButtonItem of UINavigationItem gets renamed if the title of the current controller is displayed too long. Too lazy to explain, so here are a few photos:


As you can see, when the title is too long, the Back button is renamed to Back, regardless of what it was before. If the title is even longer, the back button does not display text, just the image of the left arrow.
Does anyone know how to disable this behavior? I would like the Back button to stay exactly what I want and not to be renamed. Thanks
EDIT
I created a dirty solution by manually limiting the width of the title bar of the view controller. I found that the title font on the iPhone is System Bold 17.0, so I check what size the title will have before setting it (using the sizeWithAttributes: string method, and trim the characters from the end until the size is less than the length, which will force the back button to rename.
uiviewcontroller ios7 uinavigationitem uinavigationcontroller backbarbuttonitem
spybart
source share