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 转换代码如下: ...
随机推荐
- C# xml 常规 保护 方法总结
一 使用xsd模式文件验证xml文件: xml文件: <?xml version="1.0" encoding="utf-8" ?> <Boo ...
- 【Kafka】Kafka为什么要加入分区的概念
Kafka为什么要加入分区的概念 kafka 分区 作用_百度搜索 (1 封私信)kafka中的topic为什么要进行分区? - 知乎 Kafka安装版本选择 Apache Kafka nc使用 n ...
- POJ 1265 pick定理
pick公式:多边形的面积=多边形边上的格点数目/2+多边形内部的格点数目-1. 多边形边上的格点数目可以枚举每条边求出.如果是水平或者垂直,显然可以得到,否则则是坐标差的最大公约数减1.(注这里是不 ...
- TextEdit 只能输入数字(0-9)的限制
MaskType="RegEx" MaskUseAsDisplayFormat="True" Mask="[0-9]*" <dxe:T ...
- Kafka:ZK+Kafka+Spark Streaming集群环境搭建(八)安装zookeeper-3.4.12
如何搭建配置centos虚拟机请参考<Kafka:ZK+Kafka+Spark Streaming集群环境搭建(一)VMW安装四台CentOS,并实现本机与它们能交互,虚拟机内部实现可以上网.& ...
- [Node.js] process.nextTick for converting sync to async
For example we have a function to check the filesize: const fs = require('fs'); function fileSize (f ...
- Persistent Netcat Backdoor
In this example, instead of looking up information on the remote system, we will be installing a net ...
- 自定义控件之万能Repeater源码
using System.ComponentModel; using System.Web.UI; [assembly: TagPrefix("Jinlong.Control", ...
- Nginx反向代理转发Host设置
默认情况下反向代理是不会转发请求中的Host头部,如果需要转发,则需要配置红色字体表示的选项参数. location /t02 { proxy_set_header Host $host; proxy ...
- Velocity使用总结
一.载入Velocity依赖包 <dependency> <groupId>org.apache.velocity</groupId> <artifactId ...