UITabBarItems always show inline layout on iPad

Hi there,

I'm struggling with the layout of tab bar items when using a UITabBarController as master controller of a UISplitViewController.

In Xcode, everything looks fine, however when running on iPad (simulator or real device) the tab bar item's title always appear besides the icon. I assume this is called UITabBarItemAppearanceStyleInline.

It should, however appear "stacked", i.e. the title below the icon, which shows correctly on iPhone.


Some screenshots, here in Xcode:

http://www.tinbert.com/download/dev/TabBarInXcode.png


Here on iPad in simulator:

http://www.tinbert.com/download/dev/TabBarInSimulator.png


I have tried everything I could think of, but to me it looks like a bug in UIKit iOS 13.x.


What do you think?

Replies

Why do you expect it should appear appear "stacked" ?

I think it is automatic, depending on the size.


You can check it in IB by changing the device for IB display.


have a look here to see how to force a "below" presentation.

https://stackoverflow.com/questions/44822558/ios-11-uitabbar-uitabbaritem-positioning-issue

It happened to be the default view for years in my UI. I must admit, I have'nt touched the code for several years - and now my UI was broken when I went to iOS 12/13 SDK.


Thank you for the link to Stackoverflow. The trick with overriding traitCollection in my own UITabBar class did it for me.

Yes, that's the type of (bad) surprise we all discover when we rework some old code. Someone has moved things we relied on in the background.


Thanks for the feedback, don't forget to close the thread.

Nevertheless, I'd rather see this as a bug.

When using the tab bar controller on a master controller in split view, there is plenty of room vertically, but no room in width. So even 4 tab bar items with little text are pushed together and are not very legible at all. This would be no problem with the text beneath the icons.


http://www.tinbert.com/download/dev/TabBarInSimulator.png