سؤال

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