1

我以为我在某处读到有一种方法可以在文本视图中嵌入绘图或其他非文本,但我在 Apple 文档中找不到任何相关信息。谁能指出我正确的方向?我正在尝试构建一个编辑器,而不仅仅是一个视图。我在底层文本中想象一个特殊字符,并且基于文本属性,它会在文本布局中保留一些空白空间。? 或者我可能需要自己布局块,使用 NSTextContainers 和自定义 NSView 来围绕图形流动文本?

4

1 回答 1

2

Take a look into the NSTextAttachment and NSTextAttachmentCell. You can do your own custom drawing when you subclass the NSTextAttachmentCell.

Apple docs: Text Attachment Programming Topics

于 2010-12-10T03:03:35.810 回答