首先我們設定tabbarItem的文字為空字串@""
navigationViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"" image:normalImage selectedImage:selectImage];
複製程式碼
然後設定圖片的偏移
navigationViewController.tabBarItem.imageInsets = UIEdgeInsetsMake(5, 0, - 5, 0);
複製程式碼