修改UINavigationBar
UINavigationBarAppearance *apperance = [UINavigationBarAppearance new];
apperance.backgroundColor = [UIColor whiteColor];
apperance.backgroundEffect = nil;
self.navigationController.navigationBar.scrollEdgeAppearance = apperance;
self.navigationController.navigationBar.standardAppearance = apperance
if ([UIDevice currentDevice].systemVersion.floatValue >= 7.0) {
[[UINavigationBar appearance] setBarTintColor:[UIColor orangeColor]];
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, [UIFont fontWithName:@ "HelveticaNeue-CondensedBlack" size:21.0], NSFontAttributeName, nil]];
修改UITabbar
if (@available(iOS 15.0, *)) {
UITabBarAppearance *bar = [UITabBarAppearance new];
bar.backgroundColor = [UIColor whiteColor];
bar.backgroundEffect = nil;
bar.stackedLayoutAppearance.selected.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:k_tab_selectColor};
bar.stackedLayoutAppearance.normal.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:k_tab_normalColor};
self.tabBar.scrollEdgeAppearance = bar;
self.tabBar.standardAppearance = bar;
} else {
self.tabBar.backgroundColor = [UIColor whiteColor];
self.tabBar.barTintColor = [UIColor whiteColor];
self.tabBar.translucent = NO;
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithColor:[UIColor whiteColor]]];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:k_tab_normalColor} forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateSelected];
}