Why UIActivityViewController navigationBar backgroundColor is clear?

Under iOS 17, I need to set view.backgroundColor when using UIActivityViewController, otherwise the navigationBar will be transparent. (iOS 17 does not have this problem)

I have checked many tutorial examples but this situation is not mentioned. Is there any implementation missing from my code?

Sample Code:

let sharedURL = URL(string: "...")!
let activityVC = UIActivityViewController(activityItems: [sharedURL], applicationActivities: nil)
present(activityVC, animated: true)

Sample Image:

Answered by Frameworks Engineer in 774317022

Do you customize the navigation bar in your app? Prior to iOS 17 the navigation bar in the UIActivityViewController could potentially inherit UINavigationBar customizations and thus be influenced by them. I believe there were changes in iOS 17 that would permanently prevent this.

Accepted Answer

Do you customize the navigation bar in your app? Prior to iOS 17 the navigation bar in the UIActivityViewController could potentially inherit UINavigationBar customizations and thus be influenced by them. I believe there were changes in iOS 17 that would permanently prevent this.

Why UIActivityViewController navigationBar backgroundColor is clear?
 
 
Q