如何识别游戏包消息窗口? [英] How do I identify the gamekit message window?
问题描述
当带有GameKit的iPhone应用程序启动并且该设备已经登录到GameCenter时,屏幕顶部会出现一条小消息,上面写着欢迎回来%username!。
When an iPhone app with GameKit launches, and the device is already logged in to GameCenter, a small message slides in on top of the screen, saying something along the lines of "Welcome back %username!".
我发现的是以下内容:该消息出现在自己的 UIWindow
中,最终将消息滑走并释放。屏幕上显示该消息时,您可以注销以下内容:
What I found out is the following: that message appears in its own UIWindow
that eventually slides the message away and releases itself. When the message is onscreen, you can log out the following:
所有窗口:(
< UIWindow :0x31fc70;帧=(0 0; 320480);不透明=否;自动调整大小= RM + BM;图层=< CALayer:0x31fe60>,
< UIWindow:0x3874c0;帧=(0 0; 320480); opaque = NO; userInteractionEnabled = NO; layer =< CALayer:0x387590>>"
)
在一般情况下,我需要区分两个窗口-我需要一个-(UIWindow *)topNormalWindow
函数的东西,该函数将返回最上面的窗口,既不是A)警报也不是B)游戏中心消息。我已经有一个-(UIWindow *)topNonAlertWindow,它确定不是警报的顶部窗口,但是游戏包消息不是,但也不是(出于我的目的)普通窗口。
I need to distinguish the two windows in the general case -- I need something along the lines of a -(UIWindow *)topNormalWindow
function that will return the topmost window that isn't either A)an alert or B)the gamecenter message. I already have a -(UIWindow *)topNonAlertWindow that determines the top window that isn't an alert, but the gamekit message isn't, but nor is it (for my purposes) a normal window.
另外, autoresize = RM + BM;
是什么意思?
推荐答案
我通过简单地检查窗口是否具有 GKGameEventView
作为子视图来解决此问题。
I solved this problem by simply checking if the window had a GKGameEventView
as a subview.
这篇关于如何识别游戏包消息窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!