UIDocumentInteractionController presentPreviewAnimated navigation bar style is incorrect for ios15
Asked Answered
B

0

6

I use the UIDocumentInteractionController to present an image full screen and since upgrading to xcode 13, iOS 15 devices have white and translucent navigation bars when doing [_documentInteractionController presentPreviewAnimated:YES];. All other navigation bars are fine.

This is what the delegate looks like

- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
    UINavigationController* navController = [self navigationController];
    navController.navigationBar.tintColor = [UIColor primaryColor];
    navController.navigationBar.barTintColor = [UIColor primaryColor];
    navController.view.backgroundColor = [UIColor primaryColor];

    return navController;
}

The closest I came to fixing the issue was doing this in the delegate

    UINavigationBarAppearance *app = [UINavigationBarAppearance new];
    [app configureWithOpaqueBackground];
    app.backgroundColor = UIColor.redColor;
    [[UINavigationBar appearance] setBarStyle: UIBarStyleBlack];

    navController.navigationBar.standardAppearance = app;
    navController.navigationBar.translucent = NO;

however the bar stays translucent. This is the result, the colour should be red. Navigation bar is translucent Setting navController.navigationBar.translucent = NO; doesnt seem to make a difference.

Barrada answered 9/2, 2022 at 7:41 Comment(2)
Did you find any solution to this?Cutlerr
Unfortunatly not, now that its at least readable I'm leaving it for now until someone hopefully gives a solution. Just upvote the question to give it more traction if you need help alsoBarrada

© 2022 - 2024 — McMap. All rights reserved.