hag*_*agi 5 xcode uti ios ios8
我正在开发的 iOS 应用程序导出了 UTI。相关部分Info.plist如下所示:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>GPX Document</string>
<key>UTTypeIdentifier</key>
<string>de.company.app.gpx</string>
<key>UTTypeSize320IconFile</key>
<string>Doc320.png</string>
<key>UTTypeSize64IconFile</key>
<string>Doc64.png</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>gpx</string>
</array>
</dict>
</dict>
</array>
Run Code Online (Sandbox Code Playgroud)
我希望应用程序通过“打开方式...”对话框处理 GPX 文件,因此在同一个 PLIST 中还有一个文档类型定义(引用 UTI):
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Icon29.png</string>
<string>Icon58.png</string>
</array>
<key>CFBundleTypeName</key>
<string>de.company.app.gpx</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>de.company.app.gpx</string>
</array>
</dict>
</array>
Run Code Online (Sandbox Code Playgroud)
在 Safari 中打开 GPX 文件时,它会显示我在 下指定的图标CFBundleTypeIconFiles,即Icon58.png在视网膜设备上。该应用程序还允许通过 iOS 8 中引入的 UIDocumentPickerViewController 类进行导入,虽然 UTI 定义适用于过滤 iCloud Drive 中的相关文件,但它不显示我指定的任何图稿:

我已确保所有引用的图像文件(Icon29.png、Icon58.png、Doc64.png、Doc320.png)确实在应用程序包的根目录中。它们名称中的数字表示它们的高度(以像素为单位)。该Doc...文件是正方形,另外两个遵循此规范(仅适用于iPhone)。
我基本上有两个问题:
1) 如何让 UIDocumentPickerViewController 为我们的 UTI 显示自定义图标?
2) 是否还有其他使用案例UTTypeSize64IconFile和使用案例UTTypeSize320IconFile?
| 归档时间: |
|
| 查看次数: |
4284 次 |
| 最近记录: |