嗨
,我已经设法通过将文档类型添加到项目构建并将类型字段设置为“com.microsoft.excel.xls”(参见屏幕截图)来打开邮件应用程序的 .xls 文件。
我想对 xlsx 文件做同样的事情,但做不到。我尝试添加“com.microsoft.excel.xlsx”,但没有成功
问问题
4555 次
3 回答
18
我通过如下定义自定义 UTI 解决了这个问题。尝试将这些定义添加到您的 info.plist 中。它按预期工作。
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>XLSX input table document</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>xlsx</string>
<key>public.mime-type</key>
<string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.mydomain.myapplication.xlsx</string>
</dict>
</array>
……
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>XLSX input table document</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.mydomain.myapplication.xlsx</string>
</array>
</dict>
</array>
于 2012-03-25T23:52:17.397 回答
5
XLSX 文件的标识符是org.openxmlformats.spreadsheetml.sheet
于 2019-02-26T14:27:41.250 回答
1
XSLX 已声明为org.openxmlformats.presentationml.presentation
于 2016-11-15T21:06:13.143 回答