我试图为NSTextView指定行数。我的设计师要求最多两行文字。我尝试了NSMutableParagraph样式来添加我想要的省略号截断,但是使用NSMutableParagraph,我只能得到1行的NSTextView,而没有NSMutableParagraph的话,我可以得到一个滚动文本,它的行数可以满足完成文本的需要。
var attributedString = NSMutableAttributedString(string: "This is my text, I can keep going for many characters")
var para = NS
在NSTextView上,当将字体设置为.monospacedSystemFont时,Xcode会显示有关无效字体的警告。示例: CoreText note: Client requested name ".SFNSMono-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFo