问题
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