OS13以上通过传统的barTintColor会异常,需要区分版本设置
if(@available(iOS13.0,*)){UINavigationBarAppearance*appearance=[[UINavigationBarAppearance alloc]init];appearance.backgroundImage=[UIImage imageNamed:@"hengtu1"];//图片appearance.backgroundColor=[UIColor blueColor];//背景色appearance.shadowColor=UIColor.clearColor;//阴影appearance.titleTextAttributes=@{NSForegroundColorAttributeName:[UIColor whiteColor]};//导航栏标题颜色self.navigationController.navigationBar.standardAppearance=appearance;self.navigationController.navigationBar.scrollEdgeAppearance=appearance;}else{self.navigationController.navigationBar.barTintColor=[UIColor blueColor];}