if(@available(iOS 15.0,*)) {
UINavigationBarAppearance *apperance=[[UINavigationBarAppearance alloc]init];
apperance.backgroundColor=[UIColor whiteColor];//设置背景色
[apperance setTitleTextAttributes:@{
NSFontAttributeName:[UIFont systemFontOfSize:18],
NSForegroundColorAttributeName:[UIColor redColor]
}];//设置标题字体
apperance.shadowImage = [[UIImage alloc]init];
apperance.shadowColor=nil;//分割线去除
[UINavigationBar appearance].standardAppearance=apperance;
[UINavigationBar appearance].scrollEdgeAppearance=[UINavigationBar appearance].standardAppearance;//重新赋值
}
[UINavigationBar appearance].backgroundColor = UIColor.whiteColor;
[UINavigationBar appearance].barTintColor = UIColor.whiteColor;
[UINavigationBar appearance].tintColor = UIColor.blackColor;