jamix
jamix

Reputation: 5628

Using UITabBar.ItemPositioning in iOS 13

My UITabBarController has just two items and I want to display them closer together. This worked for me in XCode 10 / iOS 12:

override func viewDidLoad() {
    super.viewDidLoad()        
    tabBarController?.tabBar.itemPositioning = .centered
}

However, it no longer works in XCode 11 / iOS 13 - the items are spaced in the default fashion.

The documentation now refers to UITabBar.ItemPositioning as "Legacy customizations". So what is one supposed to use instead, if anything?

Upvotes: 1

Views: 960

Answers (1)

Muzahid
Muzahid

Reputation: 5186

You can set it from the interface builder. Select TabBar -> Attribute Inspector -> Item Position -> Center then you will get item spacing option.

enter image description here

Upvotes: 1

Related Questions