Swift sprite kit landscape only forced into portra

2019-08-04 18:45发布

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条回答
叼着烟拽天下
2楼-- · 2019-08-04 19:37

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

查看更多
登录 后发表回答