【发布时间】:2019-08-24 00:27:40
【问题描述】:
当我通过 NSAttributedString 在 NSTextField 中放置图像附件时,当我单击或更改它时,图像会消失。怎么了?
NSTextAttachment* attachment = [[NSTextAttachment alloc] init];
NSImage *symbolImage = [NSImage imageNamed:@"enabled.png"];
NSLog(@"%@", symbolImage);
NSTextAttachmentCell *anAttachmentCell = [[NSTextAttachmentCell
alloc] initImageCell:symbolImage];
[attachment setAttachmentCell:anAttachmentCell];
return [NSAttributedString attributedStringWithAttachment:attachment];
【问题讨论】:
-
你能在代码中展示你是如何通过 NSAttributedString 做图片附件的吗?
-
您解决了吗?我对链接也有同样的问题:stackoverflow.com/questions/8684972/…
-
不是,我没有:(如果你愿意,请告诉我
-
对此有何见解?我遇到了同样的问题。
标签: objective-c macos cocoa nsattributedstring