makeKeyWindow vs makeKeyAndVisible

心不动则不痛 提交于 2019-11-27 02:43:36

问题


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

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/25260290/makekeywindow-vs-makekeyandvisible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!