5

I'm trying to set a standard width for my UITabBarButtons by setting the following properties of my UITabBar:

    tabBar.itemPositioning = .centered
    tabBar.itemWidth = 76.0
    tabBar.itemSpacing = 34.0

When running on my physical iPad running iOS 10.1.1 the tab bar items are properly sized, but when running on the iPad pro 10.5 simulator running ios 11, the itemWidth property isn't taken into account.

iPad running 10.1.1 enter image description here

iPad Pro 10.5 inch running ios 11 enter image description here

I'm building with XCode 9 with a deployment target of ios 9.0.

Corey Zambonie
  • 614
  • 5
  • 17
  • From what I gather iOS 11 just ignores the .itemPositioning, .itemWidth, .itemSpacing properties. – Corey Zambonie Oct 03 '17 at 14:37
  • 1
    looks like `self.tabBar.itemWidth itemPositioning and itemSpacing` don't work with Regular size class (iPad). go with subclassing. Check answer here: https://stackoverflow.com/a/45945937/1207684 – dollar2048 Nov 09 '17 at 15:28

0 Answers0