本文介绍了Swift Sprite Kit风景只能逼入人像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前曾问过这个问题,但很可能是由于我的错误解释,所以我没有得到答复.我的spritekit游戏仍然存在问题,该游戏仅在横向使用.

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.

当我锁定设备或者有时只是切换到另一个人像应用程序时,然后返回到我的游戏,它被强制进入人像模式1-2秒.其他游戏则不会发生这种情况,我也不知道自己在做什么错.我已经将方向设置为仅左右横向(在Targets-General中),更改了GameViewController.swift中的方向设置,还更改了支持的界面方向"的Info.plist设置,以确保仅左右横向.

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

推荐答案

因此,经过多年的研究发现,导致此问题的原因是iAd标语.要解决此问题,只需在应用程序"WillResignActive"时从AppDelegate的superView中删除它们,并在应用程序"WillEnterForeground"时重新加载它们.

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".

信用归Iganton

Credits goes to Iganton

后台应用屏幕截图,显示双击后方向错误主页

这篇关于Swift Sprite Kit风景只能逼入人像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-19 00:16