Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/119.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在ios上实现非全屏文件预览_Ios_File_Preview_Qlpreviewcontroller - Fatal编程技术网

如何在ios上实现非全屏文件预览

如何在ios上实现非全屏文件预览,ios,file,preview,qlpreviewcontroller,Ios,File,Preview,Qlpreviewcontroller,我知道QLPreviewController可以做到这一点。但它是全屏的,我的要求是在子视图中预览文件 我尝试使用脱机窗口演示QLViewController,然后制作脱机窗口的屏幕截图 问题是我必须显示窗口,否则屏幕截图无法捕捉任何东西 那么我的问题可能是,如何在ios中为离线窗口制作屏幕截图 或者,您可能有更好的想法,以另一种方式实现文件预览 任何提示都将不胜感激。QLVeviewController可以位于子视图中 我在spliview和子类QLViewController中自行使用它 -

我知道QLPreviewController可以做到这一点。但它是全屏的,我的要求是在子视图中预览文件

我尝试使用脱机窗口演示QLViewController,然后制作脱机窗口的屏幕截图

问题是我必须显示窗口,否则屏幕截图无法捕捉任何东西

那么我的问题可能是,如何在ios中为离线窗口制作屏幕截图

或者,您可能有更好的想法,以另一种方式实现文件预览


任何提示都将不胜感激。

QLVeviewController可以位于子视图中

我在spliview和子类QLViewController中自行使用它

- (void)tableView:(UITableView *)tView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DocumentViewController *documentViewController = [DocumentViewController new];

    [self.navigationController pushViewController:documentViewController animated:YES];
    [documentViewController release];
}
其中DocumentViewController是QLPreviewController的子类:

@interface DocumentViewController : QLPreviewController <QLPreviewControllerDataSource>

@implementation DocumentViewController

...
- (id)init
{
    self = [super init];
    if (self) 
    {
        self.dataSource = self;
        self.delegate = self;
    }
    return self;
}
...
@interface DocumentViewController:QLPreviewController
@实现文档视图控制器
...
-(id)init
{
self=[super init];
如果(自我)
{
self.dataSource=self;
self.delegate=self;
}
回归自我;
}
...
并实现所需的方法(数据源需要NumberOfPreviewWitemsInPreviewController)