美文网首页
UITabBar title颜色

UITabBar title颜色

作者: CGsir陈 | 来源:发表于2022-10-10 19:07 被阅读0次

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颜色

      本文链接:https://www.haomeiwen.com/subject/lfezartx.html