Dhiru
Dhiru

Reputation: 3060

UITabBarItem Image Inset issue in Swift

I am using UITabBarController , i am setting UITabBarItem imageInset .

enter image description here

But when is am selecting same , Tab Again and again , the image size in increasing .

see here :

Tab Bar issue video

enter image description here

Have anyone faced this issue , please help

Upvotes: 1

Views: 1512

Answers (2)

The Developer
The Developer

Reputation: 21

I know I am late but for anyone reading this you have to balance out the insets. For example, I have a top inset of 3. I need to add -3 to the bottom inset so it doesn't move.

nav.tabBarItem.imageInsets = UIEdgeInsets(top: 3, left: 0, bottom: -3, right: 0)

Upvotes: 1

Atul Gupta
Atul Gupta

Reputation: 51

Don’t use all four insets (top,left,bottom,right) First of all make all four insets to 0, it will solve your problem and after that tell me why you are using insets?

Upvotes: 0

Related Questions