首页 > 其他 > 详细

UIDocumentInteractionController 文件预览

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

//创建并从底部弹出来

- (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 文件预览

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!