1纺非、tabbar相關(guān)
UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init];
//tabBaritem title選中狀態(tài)顏色
appearance.stackedLayoutAppearance.selected.titleTextAttributes = @{
? ?NSForegroundColorAttributeName:[UIColor blueColor],
};
//tabBaritem title未選中狀態(tài)顏色
appearance.stackedLayoutAppearance.normal.titleTextAttributes = @{
? ?NSForegroundColorAttributeName:[UIColor blueColor],
};
//tabBar背景顏色
appearance.backgroundColor = [UIColor blackColor];
self.tabBarItem.scrollEdgeAppearance = appearance;
self.tabBarItem.standardAppearance = appearance;
2、navigationBar相關(guān)
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
appearance.backgroundColor = [UIColor blackColor];
self.navigationBar.standardAppearance = appearance;
self.navigationBar.scrollEdgeAppearance = appearance;
3口蝠、tableView相關(guān)
為了配合以前的開發(fā)習(xí)慣博肋,我們只需要在創(chuàng)建實(shí)例的時候進(jìn)行對間距的設(shè)置即可
if (@available(iOS 15.0, *)) {
? ? tableView.sectionHeaderTopPadding = 0;
}
或者全局設(shè)置
if (@available(iOS 15.0, *)) {
? ? [UITableView appearance].sectionHeaderTopPadding = 0;
}