Question

For previous versions of iOS 7 when I needed to shift the position of the title and image (usually an icon) on a UITabBarItem two settings were required.

myViewController.tabBarItem.imageInsets = UIEdgeInsetsMake(0, -15, 0, 15); myViewController.tabBarItem.titlePositionAdjustment = UIOffsetMake(-15, 0);

This however introduced double the inset size for the image since the 7.1 update of iOS. Below is an answer based on my findings.

Was it helpful?

Solution

The first line from above is no longer required as the line

myViewController.tabBarItem.titlePositionAdjustment = UIOffsetMake(-15, 0);

now also moves the image appropriately.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top