简体   繁体   English

图像文件扩展名Xcode

[英]Image file extension Xcode

I'm programming an app similar to the email. 我正在编写类似于电子邮件的应用程序。 So when I attach a file to my message I would like to show the filename + small image (icon), this icon should be according the filetype, for example pdf if the file is a pdf, Word id the file is a word file .... 因此,当我在邮件中附加文件时,我想显示文件名+小图像(图标),该图标应与文件类型相对应,例如pdf(如果文件是pdf),Word id(文件id)是word文件。 ...

Anyone know how can I find these small images ? 有人知道如何找到这些小图像吗? Or any representative example ? 还是有代表性的例子?

Advanced thank 先进的谢谢

If this is for iOS then you can use UIDocumentInteractionController : 如果这是针对iOS的,则可以使用UIDocumentInteractionController

NSURL *url = [NSURL fileURLWithPath:pathToYourFile];
UIDocumentInteractionController *diac = [UIDocumentInteractionController interactionControllerWithURL:url];
NSArray *icons = diac.icons;
if ([icons count] > 0) {
    // This is the smallest available icon:
    UIImage *icon = [icons objectAtIndex:0];
} else {
    // No icon found.
    // According to the documentation, this case *should not* occur...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xcode 10:图像集“ customloading”引用文件“ mygif.gif”,但该文件没有有效的扩展名 - Xcode 10: The Image set 'customloading' reference a file “mygif.gif” , but that file does not have a valid extension PencilKit 的 Xcode 项目的 .drawing 扩展文件? - .drawing extension file for Xcode project for PencilKit? xcode项目中可执行文件的扩展名是什么 - what is the extension of an executable file in an xcode project Xcode 7 警告:启动图像没有有效的扩展名 - Xcode 7 warning: The launch image does not have a valid extension 使 Xcode 构建一个通过处理具有自定义扩展名的文件生成的 C 文件 - Make Xcode build a C file generated by processing a file with a custom extension 如何在 XCode 上将自定义文件扩展名导入到 iOS 项目? - How to import custom file extension to an iOS project on XCode? Xcode 6.3找不到watchkit扩展swift文件 - Xcode 6.3 can't find watchkit extension swift file 如何将具有自定义扩展名的文件添加到 XCode 中的 bundle/resource 文件夹? - How to add file with custom extension to bundle/resource folder in XCode? 使用Xcode 9构建时,文件提供程序扩展无法在iOS 9和10上启动 - File Provider Extension fails to start on iOS 9 & 10 when built with Xcode 9 通知服务扩展文件夹中的文件(图像)路径 - Path to file(image) in Notification Service Extension folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM