iOS15 NavigationBar background

Hi,I set My navigationBar like this in viewWillApper

appearance.configureWithOpaqueBackground()
appearance.backgroundColor = <your tint color>
navigationBar.standardAppearance = appearance;
navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance
UINavigationBar.isTranslucent = false

The page behaves normally when it first appears, inwiewWilDisappear,I set another style for the next page that will appear

When the page returns from another controller by dismissViewControllerAnimated:completion The background of the navigation bar will first appear transparent and then display the correct background

but works fine on iOS14

in viewWillApper:

if (@available(iOS 15.0, *)){

        UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];

        [appearance configureWithOpaqueBackground];

//        appearance.backgroundImage = [UIImage imageWithColor:[UIColor clearColor]];

        appearance.backgroundColor = [UIColor clearColor]; //

//        appearance.backgroundEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

        appearance.shadowColor = [UIColor clearColor];

        appearance.titleTextAttributes = @{NSForegroundColorAttributeName:yourFontColor_3,NSFontAttributeName: [UIFont systemFontOfSize:18]};

        for (UIView *subView in self.navigationController.navigationBar.subviews) { //Set as needed

            subView.backgroundColor = [UIColor clearColor];

        }

        self.navigationController.navigationBar.scrollEdgeAppearance = appearance;

        self.navigationController.navigationBar.standardAppearance = appearance;

    }

in wiewWilDisappear:     [self.navigationController.navigationBar setBackgroundImage:NavBacgroundImage forBarMetrics:UIBarMetricsDefault];

or

if (@available(iOS 15.0, *)){

        UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];

        appearance.backgroundImage = NavBacgroundImage;

        appearance.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};

        self.navigationController.navigationBar.scrollEdgeAppearance = appearance;

        self.navigationController.navigationBar.standardAppearance = appearance;

    }

iOS15 NavigationBar background
 
 
Q