gpt4 book ai didi

macos - 打印面板附件 View 在 OS X 10.11 中显示,但在 10.10 和 10.9 中不显示

转载 作者:行者123 更新时间:2023-12-03 17:48:40 24 4
gpt4 key购买 nike

我的 OS X 应用程序支持 10.9 - 10.11。我尝试通过添加打印附件 View 来向打印操作添加一些选项,如下所示:

MyPrintView *printView = [[MyPrintView alloc] initWithData: [self myData]];
NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView: printView];
NSPrintPanel *printPanel = [printOperation printPanel];
[printPanel addAccessoryController:[[MyPrintAccessory alloc] init]];
if (printOperation)
{
[printOperation runOperationModalForWindow:_window delegate:_window didRunSelector:nil contextInfo:nil];
}

附件 View 由 Controller 定义

@interface MyPrintAccessory : NSViewController <NSPrintPanelAccessorizing>

以及 xib 文件中定义的 View 。

在 El Capitan 中一切都按预期完美运行,但在 Yosemite 和 Mavericks 中,当打印面板让我在弹出按钮中选择我的配件时,如果我选择它,则不会显示任何内容,应显示附件 View 的空间仍为空。编译和运行时都不会生成错误消息。

有人提示如何解决此问题,或者提示如何搜索此行为的原因吗?

最佳答案

我也遇到了同样的问题。我通过将“使用自动布局”选项设置为关闭打印附件 View Nib 文件来解决这个问题。

关于macos - 打印面板附件 View 在 OS X 10.11 中显示,但在 10.10 和 10.9 中不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36549103/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com