Pergunta

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.

Foi útil?

Solução

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

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

now also moves the image appropriately.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top