如果每個(gè)item對(duì)應(yīng)的控制器是NavigationController, 那就去各自的navigationController類(lèi)中, 如果有基類(lèi)那就去基類(lèi)中,
- (instancetype)initWithRootViewController:(UIViewController *)rootViewController
這個(gè)初始化方法中添加以下代碼
self.tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0,-6, 0);//根據(jù)需要自動(dòng)調(diào)整,其中,四個(gè)變量分別對(duì)應(yīng)(上,左,下,右)
如果圖片和標(biāo)題都有, 需要整體往上移動(dòng)一點(diǎn), 同樣在navigationController里面, 其中, 第一和第三個(gè)參數(shù)負(fù)責(zé)圖片的上下拉伸, 改的話(huà)都得改
self.tabBarItem.imageInsets = UIEdgeInsetsMake(-1, 0, 1, 0);//根據(jù)需要自動(dòng)調(diào)整,其中,四個(gè)變量分別對(duì)應(yīng)(上,左,下,右)
[self.tabBarItem setTitlePositionAdjustment:UIOffsetMake(2, -3)];