NSDictionary *dic = @{NSForegroundColorAttributeName:[UIColor blackColor],NSFontAttributeName:[UIFont systemFontOfSize:18 weight:(UIFontWeightSemibold)]};
if (@available(iOS 15.0, *)) {
UINavigationBarAppearance *barApp = [UINavigationBarAppearance new];
barApp.backgroundColor = [UIColor whiteColor];
barApp.titleTextAttributes = dic;
barApp.backgroundEffect = nil;
barApp.shadowColor = nil;
self.navigationController.navigationBar.scrollEdgeAppearance = barApp;
self.navigationController.navigationBar.standardAppearance = barApp;
}else{
self.navigationBar.barTintColor = [UIColor whiteColor];
self.navigationBar.tintColor = [UIColor whiteColor];
self.navigationBar.titleTextAttributes = dic;
}
网友评论