2

フルスクリーンアプリケーション(mac)を作成したいのですが、ウィンドウはフルスクリーンです。 [window setFrame:[window frameRectForContentRect:[[window screen] frame]]display:YES animate:YES];

タイトルバーを削除できませんか?上記のコードを変更して、タイトルバーのないウィンドウを作成できますか、それとも完全に異なるものにする必要がありますか?ありがとう :)

4

2 に答える 2

4

CocoaWithLoveにはそれについての良い記事があります:

http://cocoawithlove.com/2009/08/animating-window-to-fullscreen-on-mac.html

fullscreenWindow = [[FullscreenWindow alloc]
    initWithContentRect:[mainWindow contentRectForFrameRect:[mainWindow frame]]
    styleMask:NSBorderlessWindowMask
    backing:NSBackingStoreBuffered
    defer:YES
    screen:[mainWindow screen]];
[fullscreenWindow setLevel:NSFloatingWindowLevel];
[fullscreenWindow setContentView:[mainWindow contentView]];
[fullscreenWindow setTitle:[mainWindow title]];
[fullscreenWindow makeKeyAndOrderFront:nil];
于 2011-03-22T17:03:15.680 に答える
1

Macmadeの回答NSScreenSaverWindowLevelで提案されているのではなく、ウィンドウレベルを使用して、タイトルバーの上にウィンドウを配置することに成功しました。NSFloatingWindowLevel

fullscreenWindow = [[NSWindow alloc]
                    initWithContentRect:[[NSScreen mainScreen] frame]
                    styleMask:NSBorderlessWindowMask
                    backing:NSBackingStoreBuffered
                    defer:YES];
[fullscreenWindow setLevel:NSScreenSaverWindowLevel];
// Perform further configuration here, e.g. setTitle, setBackgroundColor etc.
[fullscreenWindow makeKeyAndOrderFront:nil];
于 2012-09-24T01:05:02.047 に答える