UITabBar title颜色

if (@available(iOS 15.0, *)) {
UITabBarAppearance *appearance = [UITabBarAppearance new];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = [UIColor whiteColor];
[UITabBar appearance].standardAppearance = appearance;
[UITabBar appearance].scrollEdgeAppearance = [UITabBar appearance].standardAppearance;
appearance.stackedLayoutAppearance.normal.titleTextAttributes = @{ NSForegroundColorAttributeName:HEXCOLOR(0xADB1BB)};
appearance.stackedLayoutAppearance.selected.titleTextAttributes = @{ NSForegroundColorAttributeName: HEXCOLOR(0x8136FF)};
} else {
self.tabBar.translucent = NO;
[self.tabBar setTintColor:HEXCOLOR(0x8136FF)];
[self.tabBar setUnselectedItemTintColor:HEXCOLOR(0xADB1BB)];
}

你可能感兴趣的:(UITabBar title颜色)