Toolbar buttons shift on iOS 12.1, not iOS 12.0x

I have a main Table View with a bottom toolbar containing buttons for 3 different Table Views. When returning from one of these 3 Views to this main Table View, the buttons in this bottom toolbar jump. This app has been in development since iOS 11.4 and worked fine up throught iOS 12.0.1, but on 12.1 this button shift happens. Any ideas?

Accepted Reply

We discovered the bug causing the shifting tab bar icons. Xcode storyboard's Tab Bar setting Translucent was clicked. When we unclicked it, it functions normally. When this XCode bug is fixed we'd like to return to a translucent tab bar, please advise on status. Thank you for your help.

Replies

What jump exactly : some pixels in height, in width ? All buttons ? shuffle between buttons ? Other ?

The toolbar stays in place, but ALL of the 3 image assets (buttons in toolbar) shift in HEIGHT many hundred pixels when returning to the main table view. They shift back down a second after returning to the table view. No SHUFFLING, however.


Thanks for your guidance.

Is the toolbar at the right place (only buttons are misplaced), or does it shift as well ?


Have you defined icons for the buttons ?

If so, could you test suppressing the icons.


Note: I have reported a bug recently about the display of tabBarItems: #45 074 323: Bug display in TabBarController in XCode10.1ß2

Summary:

I have a TabBarController going to another TabBarController going to a NavigationController and finally to a ViewController.

In iB (and in simulator), the icon set for the barItem of the Navigation controller appears (as a very small 10x10 probably) image at the left bottom corner above the tabBarItem of the tabBarController as well as in NavController


Still waiting for a feedback

The toolbar stays in the right place, only the defined icons for the buttons move. If I suppress the icons, how will I tell if they are misplaced since the toolbar stays in its place? The icons are the evidence of the shift.


Thanks for you help.

For each bar item in Tab bar item, you can set a title.


You could also remove the image for only one item, and see what happens.

I've tried removing all the titles.

I've tried removing all of the images.

I've tried adding just one title.

I've tried adding just one image with no title.

I've tried disabling 2 of the 3 and 1 of the 3 buttons.


It does not happen on the iPhone X series simulators.

It does not happen when building to Simulators running iOS 12.0.1 -- only happens when building to iOS 12.1 Simulators


Thanks for hanging in with me.

We discovered the bug causing the shifting tab bar icons. Xcode storyboard's Tab Bar setting Translucent was clicked. When we unclicked it, it functions normally. When this XCode bug is fixed we'd like to return to a translucent tab bar, please advise on status. Thank you for your help.

Thanks for feedback.


Did you file a bug report ?


Don't forget to close the thread on your answer.

Yes, I filed a bug report. Do not know how to close this thread, however. Thanks.

To close a thread, select the message that is the correct or best answer and click Correct Answer

I'm experiencing the same issue whenever I try setting the additionalSafeAreaInsets for the UITabBarController. I unchecked Translucent in the storyboard and also tried setting isTranslucent to false in the code and neither of those fix this issue. I'm at a bit of a loss on what to do at this point.

Just found a solution for my case, it's not preferred by any means but I haven't found a cleaner solution.

public override var additionalSafeAreaInsets: UIEdgeInsets {
        // Fixes issue in iOS 12.1 where the tab icons jump to the left and the safe area is smaller then expected
        didSet {
            guard additionalSafeAreaInsets.bottom != 0 else {
                return
            }
            
            viewControllers?.forEach { $0.additionalSafeAreaInsets.bottom = additionalSafeAreaInsets.bottom }
            
            additionalSafeAreaInsets.bottom = 0
        }
    }

Your issue was slightly different than mine. I only experienced it on devices with 4", 4.7" and 5.5" screens, running iOS 12.1. Glad you discovered a fix, and hopefully many others filed bug reports as well, so the next iOS update will remedy. https://developer.apple.com/bug-reporting/