makeKeyAndVisible & makeKeyWindow - iPhone 中的 uiwindow
在每个应用程序中,
总是写成[window makeKeyAndVisible];
makeKey 是什么意思?
In every application,
there is always written as [window makeKeyAndVisible];
What is mean by makeKey?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
关键窗口是将接收用户交互的窗口。
您可以看一下:
http:// /developer.apple.com/mac/library/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
The key window is the window which will receive user interaction.
You might take a look at this:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
这意味着这是接受键盘输入的窗口。这与 Mac OS X 上的类似命名法相匹配。
This means that this is the window that accepts keyboard input. This matches similar nomenclature on Mac OS X.
该方法调用执行关键功能。如果省略它,则窗口的顶层视图将不会自动调整大小,但您已经设置了弹簧和支柱。我花了一段时间才弄清楚:如果通话中状态栏大小没有调整,请检查窗口是否被标记为关键。
This method call performs a critical function. If you omit it then the top level view to the window will not be autoresized however you have set the springs and struts. Took me a while to figure that out: if the in-call status bar resizing is not happening, check to see that the window is marked as key.
使接收器成为关键窗口并使该窗口可见。
这是使接收器成为主窗口并将其显示在其他窗口前面的便捷方法。您还可以使用 UIView 继承的隐藏属性来隐藏和显示窗口。
来源:http ://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html
Makes the receiver the key window and makes that window visible.
This is a convenience method to make the receiver the main window and displays it in front of other windows. You can also hide and reveal a window using the inherited hidden property of UIView.
source: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html