I have a WKWebView that I have sized to the size of the device. However when the device is rotated and I add code to viewWillTransitionToSize to change the size of the WKWebView (inside the animateAlongsideTransition block) I see a white background to the side of the WKWebView for a brief period of time as the rotation completes. This is fine in Light Mode but does not look so great in Dark Mode and I would like to be able to change the colour of this area in Dark Mode to black.
I have tried adding another UIView underneath the WKWebView (which has the benefit that I can alter its background colour between Light and Dark Mode to ensure that the status bar text is always visible to the user), but this does not solve the device rotation colour problem mentioned earlier.
I have also tried changing the Launch Storyboard and MainStoryboard view background colours and these have no effect on what is visible during the device rotation.
Has anyone else experienced this? and if so have they fixed it?
Set the Launch Storyboard and MainStoryboard view background colours to SystemBackgroundColor