码迷,mamicode.com
首页 > 其他好文 > 详细

UIDocumentInteractionController 文件预览

时间:2014-06-28 08:34:02      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:style   color   width   文件   cti   for   

//创建并从底部弹出来

- (void)viewDidLoad

{

    [super viewDidLoad];


[self setupDocumentControllerWithURL:fileURL];

    CGRect rect = CGRectMake(0, 0, ScreenWidth, ScreenHeight);

//    [self.docInteractionController presentOptionsMenuFromRect:rect inView:self.view  animated:YES];//包含快速预览菜单

    [self.docInteractionController presentOpenInMenuFromRect:rect inView:self.view animated:YES];//不包含包含快速预览菜单


}



// 创建

- (void)setupDocumentControllerWithURL:(NSURL *)url

{

    if (self.docInteractionController == nil){

        self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];

        self.docInteractionController.delegate = self;

    }

    else{

        self.docInteractionController.URL = url;

    }

}


#pragma mark - UIDocumentInteractionControllerDelegate


- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)interactionController{

    return self;

}


//不显示copy print

- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(SEL)action{

    return NO;

}


- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(SEL)action{

    return NO;

}



UIDocumentInteractionController 文件预览,布布扣,bubuko.com

UIDocumentInteractionController 文件预览

标签:style   color   width   文件   cti   for   

原文地址:http://blog.csdn.net/dengmeiyu/article/details/35269379

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!