在iOS上,我们可以从UIScreen对象访问主UIWindow对象吗? [英] On iOS, can we get to the main UIWindow object from the UIScreen object?
问题描述
说,如果我们已经有 aScreen
指向主屏幕,则
Say, if we already have aScreen
that points to the main screen, by
UIScreen *aScreen = [UIScreen mainScreen];
我们可以从该 UIScreen
对象访问主 UIWindow
对象吗?(它们之间是否有任何连接?也就是说,不要使用 [UIApplication sharedApplication] .keyWindow
))
can we get to the main UIWindow
object from this UIScreen
object? (do they have any connection at all? That is, instead of using [UIApplication sharedApplication].keyWindow
)
推荐答案
否.
应用程序有一个窗口列表,通常只有一个.每个窗口都有一个 screen
属性,该属性指示其当前位置.屏幕对象保存有关物理设备的信息.
The application has a list of windows, usually just one. Each window has a screen
property that indicates where it's currently located. The screen object holds information about the physical device.
似乎在OSX NSScreen
上受到启发,每个屏幕上没有窗口列表.每个应用都有窗口,每个窗口都知道哪个屏幕位于其中.
It seems inspired on OSX NSScreen
, there is no a list of windows per screen. Each app has windows, each window knows in which screen is located.
这篇关于在iOS上,我们可以从UIScreen对象访问主UIWindow对象吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!