为了账号安全,请及时绑定邮箱和手机立即绑定

iOS开发 预览Word文档

iOS开发 预览Word文档

iOS
慕妹229784 2018-08-29 11:36:19
在iOS4.0系统中,官方SDK提供了一个QLPreviewController,使用它就可以让我们的App在iPhone/iPad中直接预览各个文件了。官方的开发文档中说明其支持的文件类型有:iWork文档微软Office97以上版本的文档RTF文档PDF文件图片文件文本文件和CSV文件使用方法也很简单,直接alloc出一个QLPreviewController对象,用presentModalViewController方法把它调出来即可。要指定QLPreviewController预览那个文件,只要直接实现它的代理方法previewItemAtIndex,返回一个NSURL对象即可: - (id)previewController:(QLPreviewController *)previewController previewItemAtIndex:(NSInteger)idx{        return [NSURL fileURLWithPath:[NSString stringWithFormat:@“%@/Documents/files/%@”, NSHomeDirectory(), [fileList objectAtIndex:currentIndex]]];}对以上文件格式的浏览效果,还是不错的。http://www.yx-guangzhou.com/http://www.yx-guangzhou020.com/http://yx-shenzhen.com/http://www.yx-xiamen.cn/http://szkfpyxcs0755.wikidot.com/http://szdkfpyxcs0755.wikidot.com/nav:sidehttp://szdkfwfpyxcs0755.wikidot.com/http://szdkjdfpyxcs0755.wikidot.com/starthttp://szdkjcfpyxcs0755.wikidot.com/starthttp://szfp06.wikidot.comhttp://szfp07.wikidot.comhttp://szfp08.wikidot.comhttp://szfp09.wikidot.comhttp://szfp10.wikidot.comhttp://fp011.wikidot.com/http://fp012.wikidot.com/http://zsfp01.wikidot.com/http://dgkfp01.wikidot.com/http://szkfp02.wikidot.com/chatter:_templatehttp://guangzhouzsf.wikidot.com/https://cnkdshfcdnk.weebly.com/https://dsvnkdnbvjd.weebly.com/https://jhbjgjgjkhj.weebly.com/https://dsmchjdfns.weebly.com/https://bg9gybkjg.weebly.com/https://bnohfvlss.weebly.com/https://luhaonanffda.weebly.com/https://hkfofjwpq.weebly.com/https://fdlnfdjgh.weebly.com/https://yx-guangzhou.weebly.com/https://weidian.com/?userid=1372845365
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 142 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信