比如
- 设置tabBarItem的选中图片
vc.tabBarItem.selectedImage = image;
- 设置UIButtonTypeSystem样式按钮的image时
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
[btn setImage:image forState:UIControlStateNormal];
解决方案
- 再次产生一张不会进行渲染的图片
// 加载图片
UIImage *tempImage = [UIImage imageNamed:@"tabBar_essence_click_icon"];
// 产生一张不会进行自动渲染的图片
UIImage *selectedImage = [tempImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
vc.tabBarItem.selectedImage = selectedImage;
网友评论