skip to Main Content

I am trying to get the icons in the tab bar to be brought down more into the middle of the bar. I have tried setting the image insets in the story board as well as through code and none of it is working.

I’m currently using iOS 15 + Xcode 13.1.

EX: (top: 6, right: 0, bottom: -6, left: 0)

This is an example of the code I attempted as well:

tabBar.items?[0].imageInsets = UIEdgeInsets(top: 6, left: 20, bottom: -6, right: 0)

This is a picture of the current state. You’ll see that even without a title, all the icons float to the top of the bar and I want them to be aligned lower in the bar.

2

Answers


  1. I am not 100% sure but as far as I know there is no way to change it’s alignment.

    Login or Signup to reply.
  2. I would not recommend modifying the native tab bar. If you definitely want to update the position of tab bar items I encourage you to use a custom tab bar. You will have a lot more control over how it behaves and you will avoid any hacky solution.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search