Show Icons for Custom UTIs in UIDocumentPickerViewController

心已入冬 提交于 2019-12-05 17:01:18

Unfortunately, the answer is that it cannot be done unless your app has control over how these files are written to disk. In that case, you can subclass UIDocument and write out thumbnails. Here is the original answer posted by an Apple engineer, posted on the Apple developer forums (login required). It includes a code sample to illustrate how it's done.

I haven't found an answer to the second part of my question yet.

I believe you are using the wrong size icons in your CFBundleTypeIconFiles key. The size you are using are for the settings icon.

To test my theory, please add a few more files with different sizes. Plus all icons are square. The image you have in your question looks rectangular.

According to the section Icon and Image Design --> App Icon:

Document Icons

If your iOS app creates documents of a custom type, you want users to be able to recognize these documents at a glance. You don't need to design a custom icon for this purpose because iOS uses your app icon to create document icons for you.

And Excerpt from App Icons:

App icon (required) (iPhone)

  • 60 x 60 pixels
  • 120 x 120 pixels (@2x)

This is the main icon for apps running on iPhone and iPod touch in iOS 7 and later.

Settings icon (All devices)

  • 29 x 29 pixels
  • 58 x 58 pixels (@2x)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!