可可灰色消息覆盖 [英] Cocoa Grey Message Overlay
问题描述
Mac OS X上的各种应用程序以灰色,透明,圆角的框叠加显示消息,以通知用户某事;例如Xcode中的Build Succeeded消息,Lion在线搜索栏中的循环搜索消息和Chrome的退出前警告消息。
Various applications on Mac OS X display messages in a grey, transparent, rounded box overlay to notify the user of something; for example the "Build Succeeded" message in Xcode, the looped search message in the Lion inline-search bar and Chrome's "Warn Before Quitting" message.
消息框我在描述: http:/ /2.bp.blogspot.com/-eG890NRhQbs/Ty0vLkqpBWI/AAAAAAAAAMs/PO2EbJ3lTs0/s1600/Xcode-11.png
因为他们都很在格式化中类似,假设存在用于显示类似消息的某种标准函数是有意义的。如何在我自己的Cocoa应用程序中有这样的效果?
As they're all very similar in formatting, it makes sense to assume there are some sort of standard functions for displaying a similar message. How can I have such an effect in my own Cocoa application?
推荐答案
没有公共系统API。
There isn't a public system API to do them.
您可以看看Matt Gemmell的版本:向下滚动到此页面。
You could have a look at Matt Gemmell's version: scroll down to RoundedFloatingPanel on this page.
或者,如果您想对其他人使用Google,则通常称为Bezels。绘制系统的私有框架是BezelServices。
Alternatively, if you want to Google for others, they're often known as Bezels. The private framework that draws the system ones is BezelServices.
这篇关于可可灰色消息覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!