zoukankan      html  css  js  c++  java
  • UIDocumentInteractionController 文件预览

    //创建并从底部弹出来

    - (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;

    }



  • 相关阅读:
    Sql例子Sp_ExecuteSql 带参数
    Flex显示麦克风当前音量
    无法将 flash.display::Sprite@156b7b1 转换为 mx.core.IUIComponent
    FMS (端口问题)如何穿透防火墙
    19:A*B问题
    6264:走出迷宫
    2753:走迷宫
    1792:迷宫
    换钱问题(经典枚举样例)
    1943(2.1)
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/4246073.html
Copyright © 2011-2022 走看看