【问题标题】:Custom Dropdown Dialogs (Similar to the Save Dialog)自定义下拉对话框(类似于保存对话框)
【发布时间】:2013-04-10 23:14:39
【问题描述】:

是否可以创建类似于文件保存对话框的自定义下拉对话框?下面的链接也说明了这一点。

Save Dialog

感谢您的帮助

【问题讨论】:

    标签: objective-c macos drop-down-menu window save


    【解决方案1】:

    “下拉对话框”称为工作表,可以是 NSWindow。

    让它们出现的方法可以在 NSApplication 上找到:beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

    一个超级简单的实现看起来像这样:

    NSWindowController *sheet = [[NSWindowController alloc] initWithWindowNibName:@"Sheet"];
    
    [NSApp beginSheet: sheet.window
       modalForWindow: self.view.window // The window from where the sheet will appear
        modalDelegate: self
       didEndSelector: nil // Optional @selector(didEndSheet:returnCode:contextInfo:)
          contextInfo: nil];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多