0
我在NSWindowController中提供了一個NSPanel。當我按下NSPanel標題欄的紅色小按鈕時,我想用不同的動畫改變它消失的方式。我怎麼做?有沒有像 - (void)closeButtonPressed,我可以改變。因爲NSWindow的 - (void)關閉不像我想要的那樣工作。當我提出它,我不喜歡這樣寫道:
當我單擊紅色關閉按鈕時,如何以及在哪裏可以更改關閉NSPanel的動畫?
[self.imagePanelController.previewPanel setFrame:NSRectFromCGRect(CGRectMake(self.window.frame.origin.x + self.window.frame.size.width/4 , self.window.frame.origin.y + self.bounds.size.height/4, self.ciImage.extent.size.width, self.ciImage.extent.size.height)) display:YES animate:YES];
我想重新設置一個新的框架和動態顯示,按下面板上的關閉按鈕時。有任何想法嗎?
短渲染的東西成層和其動畫的,Windows系統有一個[動畫行爲(https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/ NSWindow_Class /參考/#的reference.html // apple_ref/OCC/instm/NSWindow/setAnimationBehavior :)。 – CodaFi