1.原来的设置tabBarTitle选中及未选中状态的颜色代码失效
使用新代码
if (@available(iOS 13.0, *)) {
UITabBarAppearance *appearance = UITabBarAppearance.new;
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
UITabBarItemStateAppearance *normal = appearance.stackedLayoutAppearance.normal;
UITabBarItemStateAppearance *selected = appearance.stackedLayoutAppearance.selected;
if (normal) {
normal.titleTextAttributes = @{NSForegroundColorAttributeName:k_TabbrTextColor,NSParagraphStyleAttributeName : paragraphStyle};
}
if (selected) {
selected.titleTextAttributes = @{NSForegroundColorAttributeName:k_TabbrSelectedTextColor,NSParagraphStyleAttributeName : paragraphStyle};
}
self.tabBar.standardAppearance = appearance;
}
2.原本设置cell的accessoryType
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
如果你不准备适配暗夜模式,只将cell的背景色统一设置,UITableViewCellAccessoryDisclosureIndicator同样会将箭头图片的颜色进行修改,导致和cell背景色颜色相近。
解决办法是使用accessoryView属性,
self.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_arrowright_gray"]];