So as we know UINavigationController automatically presents Back button if new view controller was pushed to navigation controller's stack. If title was not set in previous view controller, back button shows default "Back" title. If I set title in previous view controller, back button shows that title. This is how it looks like:
Though sometimes, if that title is too long, back button title changes to the default "Back". It then looks like this:
That is expected behaviour and I'm fine with it.
The problem is that my app is localized to 3 different languages. I localize all controller's titles manually so when full title is shown in back button everything is fine.
The problem occurs when (localized) title is too long and it gets replaced with default "Back" title, which is in english (or default language, specified in iOS settings) and not in the language that my app currently shows.
So my question is how can I manually set back button title only when previous controller's title is too long?
I should add that I tried replacing default back button like that:
this.NavigationItem.BackBarButtonItem = new UIBarButtonItem (localizedBackTitle, UIBarButtonItemStyle.Plain, null);
It works fine, but back button title becomes 'static' and never shows the title of previous controller.