我想在NSAlert
,beginSheetModalForWindow
,NSWarningAlertStyle
中使用NSInformationalAlertStyle
创建一个NSCriticalAlertStyle
,而在NSBeginAlertSheet
,NSBeginCriticalAlertSheet
中没有任何图标?
此外,如果我使用{{1}},{{1}}等功能API,如何从中删除图标?
答案 0 :(得分:4)
答案 1 :(得分:0)
你不能! NSAlert始终显示应用程序图标:https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSAlert_Class/Reference/Reference.html
图标:警报的图标。 nil恢复应用程序图标。
讨论: 默认情况下,图像是应用程序图标,可通过应用程序包的NSApplicationIcon属性访问。
考虑子类NSAlert或创建自己的对话框。