2016-07-29 120 views
0

我似乎无法增加NSAlert的字体大小 - 甚至整个框的大小。以编程方式增加NSAlert的字体大小

else if array[arraycount].containsString("Error: error.") { 
    let myPopup: NSAlert = NSAlert() 
    myPopup.alertStyle = NSAlertStyle.WarningAlertStyle 
    myPopup.addButtonWithTitle("I've Called!") 
    myPopup.informativeText = "Sorry, we weren't able to that. Please Call Support 1(800)234-4567 ext: 12345" 
    myPopup.runModal() 
    let app = NSRunningApplication.currentApplication()       
    app.activateWithOptions(.ActivateIgnoringOtherApps) 
} 

这是我当前的代码工作正常,但我会在iMac上运行我的OS X应用程序和文字看起来真的很小。我希望以编程方式增加磅值,但在Swift中我找不到它。任何帮助,将不胜感激!

+2

NSAlert的文档是英文的,您是否尝试阅读它?你有没有看到'messageText'? – Willeke

+0

我实际上想设置我的字体大小,而不仅仅是使用预定义的字体。尽管我可以阅读英文,但我无法找到任何可以做到的事情。 :-) – cheesydoritosandkale

回答

1

不要设置informativeText,那真的很小。

取而代之,设置messageText。这更大,更大胆。

更好的是,两者都设置,所以更重要的信息是大而大胆,重要性不高的信息很小。

myPopup.messageText = "Sorry, we weren't able to that." 
myPopup.informativeText = "Please Call Support 1(800)234-4567 ext: 12345"