los中预览文件
#import <UIKit/UIKit.h>
#import <QuickLook/QuickLook.h> @interface ViewController : UIViewController<QLPreviewControllerDataSource>
- (IBAction)click:(id)sender; @end
#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
} - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} - (IBAction)click:(id)sender {
//第一步 实例化对象
QLPreviewController *QL=[[QLPreviewController alloc] init];
QL.dataSource=self;
QL.currentPreviewItemIndex=;
[self presentViewController:QL animated:YES completion:^{ }]; [QL release];
} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
} //第二 实习代理方法
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{
return ;
} /*!
* @abstract Returns the item that the preview controller should preview.
* @param panel The Preview Controller.
* @param index The index of the item to preview.
* @result An item conforming to the QLPreviewItem protocol.
*/
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index{ return [NSURL fileURLWithPath:@"/Users/zy/Desktop/2013下半年岗位培训需求.xlsx"];
} @end
参考文章 http://61.177.61.252:80/szzssw/taxCommon.action?code=1101&id=dc54f6cb87824bbe8b3d3ae1a755f1e2
los中预览文件的更多相关文章
- 在网页中预览excel表格文件
		
项目需求在前端页面中实现预览excel表格的功能,上网了解之后大致总结为一下几种方法. 1.office文档转换为pdf,再转swf,然后通过网页加载flash进行预览 2.通过 xlsx.js,js ...
 - VS Code 如何直接在浏览器中预览页面
		
VS Code 预览html页面的时候,默认需要在资源管理器中显示,再在浏览器中预览.今天介绍一下如何直接预览html页面. 方法一:自己配置快捷键 1.ctrl + shift + p 或者 F1 ...
 - 解决微信官方SDK给出1.4.0等版本没有预览文件(previewFile)等接口
		
使用苹果手机测试 调用微信的js-sdk在系统中实现上传.预览附件的功能.在自己的手机测试通过后,直接丢给QA测试了 本以为相安无事了,没想到QA用安卓手机测的时候居然不得,使用的是下载下来的jwei ...
 - Dynamics AX 2012 R2 SSRS报表在VS2010中预览没有数据
		
今天,Reinhard 在VS中制作SSRS报表,预览的时候发现显示不出数据. 仔细检查了数据处理环节和临时表里的数据,都发现没有问题. 用同事的账号登陆同样的开发环境,发现他的账号可以在VS中预览到 ...
 - 文件批量上传-统一附件管理器-在线预览文件(有互联网和没有两种)--SNF快速开发平台3.0
		
实际上在SNF里使用附件管理是非常简单的事情,一句代码就可以搞定.但我也要在这里记录一下统一附件管理器能满足的需求. 通用的附件管理,不要重复开发,调用尽量简洁. 批量文件上传,并对每个文件大小限制, ...
 - Windows-快速预览文件-QuickLook
		
开源.免费的文件快速预览工具, 支持图片.文档.音视频.代码文本.压缩包等多种格式. 获得 Mac OS 空格键快速预览文件相同的体验 效果图 文件夹 音视频 浏览 压缩包,文本 支持的格式: 图片: ...
 - WinForm中预览Office文件
		
WinForm预览Office文档 使用WinForm, WPF, Office组件 原理:使用Office COM组件将Word,Excel转换为XPS文档, 将WPF的DocumentViewer ...
 - supermap中预览osgb格式的倾斜摄影文件
		
参考: https://zhidao.baidu.com/question/136723493545478005.html 使用的是SuperMap IDesktop 9D,操作方法如下: 打开超图, ...
 - 在线预览文件(pdf)
		
1.flash版(借助flexpaper工具) 可以把pdf文件用pdf2swf工具转换成swf文件.下载地址http://www.swftools.org/download.html 转换代码如下: ...
 
随机推荐
- [PowerShell Utils] Automatically Change DNS and then Join Domain
			
I would like to start a series of blog posts sharing PowerShell scripts to speed up our solution ope ...
 - Letter Combinations of a Phone Number leetcode java
			
题目: Given a digit string, return all possible letter combinations that the number could represent. A ...
 - 大数据开发实战:Stream SQL实时开发一
			
1.流计算SQL原理和架构 流计算SQL通常是一个类SQL的声明式语言,主要用于对流式数据(Streams)的持续性查询,目的是在常见流计算平台和框架(如Storm.Spark Streaming.F ...
 - Oracle学习笔记(6)——函数
			
函数的作用 方便数据的统计 处理查询结果 函数的分类 Oracle内置的系统函数 数值函数 四舍五入 ROUND ...
 - Linq-插入insert
			
1.简单形式 说明:new一个对象,使用InsertOnSubmit方法将其加入到对应的集合中,使用SubmitChanges()提交到数据库. NorthwindDataContext db = n ...
 - Kafka:ZK+Kafka+Spark Streaming集群环境搭建(三)安装spark2.2.1
			
如何搭建配置centos虚拟机请参考<Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网.& ...
 - c++ string wstring 字符串替换
			
int CStringTool::Replace(std::wstring& strContent, std::wstring& strReplace, std::wstring ...
 - Authentication and Authorization in ASP.NET Web API
			
You've created a web API, but now you want to control access to it. In this series of articles, we ...
 - 【python】理想论坛爬虫1.08
			
#------------------------------------------------------------------------------------ # 理想论坛爬虫1.08, ...
 - DIV+CSS IE6/IE7/IE8/FF兼容问题汇总
			
1.IE8下兼容问题,这个最好处理,转化成ie7兼容就可以.在头部加如下一段代码,然后只要在IE7下兼容了,IE8下面也就兼容了 <meta http-equiv="x-ua-comp ...