iOS解决分栏控制器或者导航栏图片不能正确显示的问题

我们只需要改一下图片的渲染模式就可以得到我们想要的效果

这里写图片描述

UITabBarItem * tabBarInformation = [UITabBarItem new];
tabBarInformation.image = [[UIImage imageNamed:@"笔记本"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
mainViewController.tabBarItem = tabBarInformation;
tabBarInformation.title = @"信息";

将渲染方式改为UIImageRenderingModeAlwaysOriginal即可

猜你喜欢

转载自blog.csdn.net/qq_40596811/article/details/81564229