if (@available(iOS 13.0, *)) {
UITabBarAppearance *appearance = UITabBarAppearance.new;
NSMutableParagraphStyle *par = [[NSMutableParagraphStyle alloc]init];
par.alignment = NSTextAlignmentCenter;
UITabBarItemStateAppearance *normal = appearance.stackedLayoutAppearance.normal;
if (normal) {
normal.titleTextAttributes = @{NSForegroundColorAttributeName:kFontBlue,NSParagraphStyleAttributeName : par};
}
UITabBarItemStateAppearance *selected = appearance.stackedLayoutAppearance.selected;
if (selected) {
selected.titleTextAttributes = @{NSForegroundColorAttributeName:kGreen100,NSParagraphStyleAttributeName : par};
}
self.tabBar.standardAppearance = appearance;
}
iOS开发之iOS13的适配(tabbar)
最新推荐文章于 2022-01-18 23:15:26 发布