I set up two images to a tabBarItem
. Since I did not find a way to change the center of the image, I used the following method to make the image effect go up a few pixels, above UITabBar
:
self.navigationController.tabBarItem.imageInsets = UIEdgeInsetsMake(4, 0, -5, 0);
It worked perfectly!
But during use, when the button is clicked several times in a row, the image is stretched.
Normal status:
Afterafewclicksonthebutton:
How to correctly adjust the height of the image, or change the height of the UITabBarItem
itself, without experiencing this problem?