wkwebview 预览文件,WKWebView支持哪些文件类型?

UIWebView supports a whole list of file types, as detailed in this Apple Technical Q&A doc:

In addition to HTML content, UIWebView can display specific document types.

iPhone OS 2.2.1 supports the following document types:

Excel (.xls)

Keynote (.key.zip)

Numbers (.numbers.zip)

Pages (.pages.zip)

PDF (.pdf)

Powerpoint (.ppt)

Word (.doc)

iPhone OS 3.0 supports these additional document types:

Rich Text Format (.rtf)

Rich Text Format Directory (.rtfd.zip)

Keynote '09 (.key)

Numbers '09 (.numbers)

Pages '09 (.pages)

Which is great. These days however they generally advise that developers use WKWebView instead of UIWebView as it's faster and offers significant JavaScript performance improvements. This is great, except that I can't find a list of file types that are supported.

It does appear to support media files (such as Quicktime .mov files) which UIWebView did not, but now Word documents (.docx) do not seem to work. Is there a list of file formats that are supported by WKWebView?

解决方案

I had the same question. I lodged a Technical Support Incident with Apple and received this answer (21st Sep 2017):

All Microsoft Documents are supported.

All iWork documents are supported.

If UIWebView would render a document type then WKWebView will as well.

On an iOS device running 10.3.3 and the Xcode 9.0 iOS 11.0 simulator, the above seems to work. I can display a range of MS Office documents (including docx, pptx, xlsx) as well as the UIWebView ones documented by Apple in QA 1630.

The above list is however lacking at least the various image formats, so it's clearly incomplete. If I get more information from Apple I'll update this answer...

(Bug report 17972625 requests WKWebView's documentation be updated to precisely specify what formats it does actually support, if you care to submit a duplicate to Apple Bug Reporter.)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值