[iOS] Fix orientation change in runtime.

This commit is contained in:
bruvzg
2023-06-12 10:55:26 +03:00
parent 54ab17eb21
commit 974a7a89c6
2 changed files with 6 additions and 0 deletions

View File

@@ -568,6 +568,11 @@ float DisplayServerIOS::screen_get_max_scale() const {
void DisplayServerIOS::screen_set_orientation(DisplayServer::ScreenOrientation p_orientation, int p_screen) {
screen_orientation = p_orientation;
if (@available(iOS 16.0, *)) {
[AppDelegate.viewController setNeedsUpdateOfSupportedInterfaceOrientations];
} else {
[UIViewController attemptRotationToDeviceOrientation];
}
}
DisplayServer::ScreenOrientation DisplayServerIOS::screen_get_orientation(int p_screen) const {