iOS15导航栏设置
2023-05-19 本文已影响0人
烟雨酱南
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;
}