Problem
Currently I'm developing an application and on iOS 16 the text color of the statusbar is often white while the background color of the customized header has a light color. In the code of the customized header there's a check that should set the correct UIStatusBarStyle based on the color of the header. When the header has a light color the text in the status bar should be black and the text should be white when the background color of the header is dark.
Since iOS 16 this logic doesn't work properly anymore and I've tried to fix it but it doesn't seem to work.
I don't have this behavior on simulators but I can reproduce it on an iPhone 12 with iOS 16.
The project uses Xamarin.iOS and C#.
What I tried
- In the AppDelegate I've set the UIStatusBarStyle to DarkContent when the iOS is 16.
- In the customized header I set the UIStatusBarStyle to DarkContent when the iOS is 16 with an if statement and a return. I also set the UIStatusBarStyle to DarkContent when the backgroundcolor of the header has a light color (fall back for other iOS versions).
Does anyone have the same behavior on iOS 16 with the UIStatusBarStyle? I only found one post about it and it's more for the end user and not for developers.