1.现在我们拿UITabbarController举例,来验证imageWithRenderingMode:的两种不同传参方式引起的最终效果,看如下代码:
UITabBarController *tabbarCon = [[UITabBarController alloc]init];
tabbarCon.tabBar.barTintColor = [UIColor colorWithHex:0xEFF0DB alpha:0.5];
tabbarCon.delegate = self;
MainViewController *firstView = [[MainViewController alloc]init];
UINavigationController *navigation1 = [[UINavigationController alloc]initWithRootViewController:firstView];
ContactViewController *secondView = [[ContactViewController alloc]init];
UINavigationController *navigation2 = [[UINavigationController alloc]initWithRootViewController:secondView];
2.这里创建了两个tabbarItem:
UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"首页" image:[UIImage imageNamed:@"tabbar_home_f"] selectedImage:[UIImage imageNamed:@"tabbar_home"]];
navigation1.tabBarItem = item1;
UITabBarItem *item2 = [[U