Terry
Terry

Reputation: 1

Is there a way to change the image position in UITabBar or UITabBarItem?

So, I created the image too big for the TabBarItem, and parts of the image appear beyond the top of the TabBar

Image here

I could:

  1. Resize all the images in the Image.xassets
  2. Write a function to resize the image so it fits in the TabBarItem area

I searched online but couldn't find a solution. Is it possible to do No.2? Thanks!

Upvotes: 0

Views: 258

Answers (1)

mohammadreza
mohammadreza

Reputation: 235

As mentioned in HIG (Apple Human Interface Guidelines) size of tab bar icons should be 69px × 69px (23pt × 23pt @3x) in regular mode and 51px × 51px (17pt × 17pt @3x) for compact mode. I suggest solution number one and resize all tab bar images.

You can read more in HIG:

https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/

Upvotes: 1

Related Questions