iOS15 - 导航栏颜色变成透明的了

 UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:homeVC];
         UINavigationBarAppearance *appearance =[UINavigationBarAppearance new];
         [appearance configureWithOpaqueBackground];
         appearance.backgroundColor =  WhiteColor;
         nav.navigationBar.standardAppearance = appearance;
         nav.navigationBar.scrollEdgeAppearance = nav.navigationBar.standardAppearance;
     self.window.rootViewController = nav;

你可能感兴趣的:(iOS15 - 导航栏颜色变成透明的了)