本文介绍了makeKeyWindow vs makeKeyAndVisible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

makeKeyWindow makeKeyAndVisible 之间的区别是 UIWindow ?

What is the difference between makeKeyWindow and makeKeyAndVisible which are two methods of UIWindow ?

UIWindow 何时成为 keyWindow 但不会显示?

When will a UIWindow be a keyWindow but will not be visible?

推荐答案

每个窗口前面都会显示一个窗口,窗口位于较低级别,并且每个窗口后面都有一个更高级别的窗口。

Each UIWindow has a windowLevel. A window is displayed in front of each window with a lower level, and behind each window with a higher level.

但是同一级别的两个窗口呢?默认情况下,最近设置的级别的窗口位于前面。 (当一个窗口进入一个新的级别时,它会在该级别的所有同级之前进行排序。) makeKeyWindow 消息会生成一个窗口键,但该窗口可能是部分或完全隐藏在同一级别的另一个窗口后面。 makeKeyAndVisible 消息生成一个窗口键,将其移动到其级别上任何其他窗口的前面。

But what about two windows with the same level? The window whose level was set more recently is in front, by default. ("When a window enters a new level, it’s ordered in front of all its peers in that level.") The makeKeyWindow message makes a window key, but that window might be partially or completely hidden behind another window on the same level. The makeKeyAndVisible message makes a window key, and moves it to be in front of any other windows on its level.

这篇关于makeKeyWindow vs makeKeyAndVisible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 13:57