objective-c - 当我在 NSTextAttachment 中拖动图像时,它是一个 .rtf
问题描述
我有一个NSTextView
显示这样的图像。
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
NSImage *attachImage = [NSImage imageNamed:@"Settings"];
attachment.image = attachImage;
NSAttributedString *attributedString = [NSAttributedString attributedStringWithAttachment: attachment];
[[self.textView textStorage] appendAttributedString:attributedString];
图像显示正确,但我无法将图像从文本字段拖到我的桌面上。每次我尝试时,我最终都会得到一个 .rtf 文件而不是图像。无论如何围绕这个问题?
解决方案
推荐阅读
- wpf - WPF组合框排序,但最初没有选择条目?
- android - 为 DialogFragment 上的导航栏设置颜色
- r - GenSA 和 SA 为背包问题提供无意义的输出
- python - Django 数据库迁移随着“元”类的添加而停止
- flutter - 如何在颤动中检查用户会话并通过路由?
- javascript - 基于文档查询选择器定义 VAR 不起作用
- javascript - Promise 既解决又拒绝
- r - 同时修剪多个变量的因子标签
- r - 如何在 sendmailR 电子邮件中嵌入图像内联(不是附件)?
- html - 为什么 min-height:100vh 在容器上不起作用?