Normally on each tab of a UITabBar
you have a small image and a title naming the tab. The image is positioned/centred towards the top of the tab to accommodate the title underneath. My question is: if you want to have a tabBar with just an image and no title is there a way to move the image down so it centers better within the tab?
I am using (see below) currently:
[tabBarItem setFinishedSelectedImage:tabSelected withFinishedUnselectedImage:tabUnselected];
but would prefer to use to larger image with no title, at the moment if I make the image bigger than about 70pixels@2x it starts edging off the top of the UITabBar
whilst leaving a lot of unused space at the bottom.
Make a subclass of
UITabBarController
, and in itsviewDidLoad
:Swift 3:
In Swift 4.2,
UIEdgeInsetsMake
is depricated, instead we should useUIEdgeInsets
,