更改主窗口上的 Alpha - Cocoa

发布于 2024-08-04 18:43:56 字数 108 浏览 3 评论 0原文

我想知道当我打开应用程序和关闭应用程序时是否可以缓慢增加 alpha MainWindow。我知道这可能涉及到计时器之类的东西,但我以前从未处理过这种事情。我需要你们的帮助...!

凯文

I want to know if I can slowly increase the alpha MainWindow when I open the app and when I close the app. I know it may involve timers, and things like that, but I never dealt with this kind of thing before. I need your help guys...!

Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦冥 2024-08-11 18:43:56

使用 NSViewAnimation。尽管有这个名字,但它适用于窗口和视图。

Use NSViewAnimation. Despite the name, it works on windows as well as views.

微暖i 2024-08-11 18:43:56

[自我设置Alpha值:0];

这将设置窗口的 Alpha。只需创建一个 NSTimer,通过增加或减少来提高或降低 alpha 值。该值为 <#(CGFloat)windowAlpha#>。

[self setAlphaValue:0];

That'll set the alpha of the window. Just create an NSTimer that either adds or subtracts to bring the alpha up or down. The Value is an <#(CGFloat)windowAlpha#>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文