开发者

Modal sheet window not centered

开发者 https://www.devze.com 2023-03-08 16:55 出处:网络
I\'m trying to open a sheet window on my cocoa app: MyWindowController *controller = [[MyWindowController alloc] init];

I'm trying to open a sheet window on my cocoa app:

MyWindowController *controller = [[MyWindowController alloc] init];

NSWindow *window = [NSApp mainWindow];

[NSApp beginSheet:controller.window modalForWindow:window modalDelegate:self didEndSelector:nil contextInfo:nil];

The problem is that the sheet is not attached to the current window, instead it's shown in the bottom left of the screen. I've tried开发者_开发知识库 to use self.view window but nothing changed. What should I do to have the sheet positioned at the top-enter of my window?


Make sure that Visible At Launch is unchecked for your sheet window.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号