Swift sprite kit landscape only forced into portra

2019-08-04 19:04发布

问题:

I have asked this question before but maybe due to my bad explanation unfortunatly I did not get a reply. I am still having the issue with my spritekit game that is in landscape only.

When I lock my device or sometimes just switch to another portrait app, and than return to my game it is forced into portrait mode for 1-2 secs. This does not happen with other games and I do not understand what I am doing wrong. I have set orientation to landscape left and right only (in Targets-General), changed the orientation settings in GameViewController.swift and also changed the Info.plist settings for "supported interface orientation" to make sure it is only landscape left and right.

What am I missing? I would appreciate any replies. Thank you very much

回答1:

So it turns out after ages of research that it is the iAd Banners that cause this issue. To fix it simply remove them from the superView in AppDelegate when application "WillResignActive" and reload them when application "WillEnterForeground".

Credits goes to Iganton

Background app screenshot showing wrong orientation after double tapping home