Home > Software design >  Tab Bar icons are not conforming to image insets
Tab Bar icons are not conforming to image insets

Time:12-15

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.

CodePudding user response:

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

CodePudding user response:

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.

  • Related