tabbar - 取消系统渲染

时间:2024-07-03 00:05:02

/**  1. 取消自动渲染 - 图片***/

viewCon1.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabbar_home_selected_os7"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

[注意]: tabbar 设置image, 默认渲染成为蓝色; stack over flow 这个网站很不错!!!

/**  2. 取消自动渲染 - 标题***/

  [viewCon1.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor redColor]} forState:UIControlStateHighlighted];

[viewCon1.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]} forState:UIControlStateNormal];

/**  3. 当detailVc被push的时候, detailVc所在的tabbarCon 隐藏tabBar ***/

detailVc.hidesBottomBarWhenPushed = YES;