I am using a UITabBarController with 3 tabs. The text of only the first tab is being duplicated. By using the view inspector, and inspecting the duplicated item, we can see that it is exactly the same object reference between the two tab bar items, which doesn't make sense. How can the same view appear simultaneously with 2 different frames. I'm not doing anything special to wire up these tabs, and only the first tab is duplicated. They are wired through interface builder. I also tried stripping it down to the bare minimum, where I'm not executing any code to customize the tab bar - the problem still persists. It occurs on iOS10.
Asked
Active
Viewed 371 times
1 Answers
2
I found the answer. I was setting the title in the View controller of the first tab's view controller like this:
[self.parentViewController setTitle:@"Song Lists"];
Removing that got rid of the Left-aligned version of the tab text, and leaves the centre-aligned version which is defined in the storyboard tab title.

FranticRock
- 3,233
- 1
- 31
- 56
-
For localizable applications there's problem, which can only occur at certain languages. For example, for me problem was here: `self.parent?.title = NSLocalizedString(...)`, which was left from legacy invalid architecture (Navigation -> Tab Bar) and occurred only at Tab Bar. – x0 z1 Sep 04 '18 at 10:52