Change Alpha on Main Window - Cocoa

痞子三分冷 提交于 2019-12-24 21:30:16

问题


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


回答1:


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




回答2:


[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#>.



来源:https://stackoverflow.com/questions/1448931/change-alpha-on-main-window-cocoa

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