質問

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.

役に立ちましたか?

解決

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

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

now also moves the image appropriately.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top