0
有沒有辦法繪製全屏疊加,然後在上面畫一個標籤+文本框?如何在其上繪製全屏疊加和文本+文本字段?
我已經做了:
當用戶點擊按鈕,屏幕應該被疊加覆蓋。
在 AppDelegate.m按鈕操作方法我寫:
NSRect frame = [[NSScreen mainScreen] frame];
self.mainWindow = [[NSWindow alloc] initWithContentRect:frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
[self.mainWindow setAcceptsMouseMovedEvents:YES];
[self.mainWindow setOpaque:NO];
[self.mainWindow setLevel:CGShieldingWindowLevel()];
[self.mainWindow setBackgroundColor:[NSColor colorWithDeviceRed:0.0 green:0.0 blue:0.0 alpha:0.7]];
[self.mainWindow orderFrontRegardless];
NSApplicationPresentationOptions options = NSApplicationPresentationDisableProcessSwitching + NSApplicationPresentationHideDock + NSApplicationPresentationDisableForceQuit + NSApplicationPresentationDisableSessionTermination + NSApplicationPresentationDisableHideApplication;
[NSApp setPresentationOptions:options];
它的工作不錯,但沒有任何動畫&我真的不知道如何繪製對象(標籤/文本框)在它?
要麼我應該將此方法移動到另一個類中嗎?