문제

Is there a way to use one of this preview controls with UISplitViewController's detail view..

I'm trying to preview Documents of the application, and made the file browser part.. But the other part still eludes me..

Whatever I did to show preview on a detail view on SplitViewController ended with failure.. Could you help me? How could I achieve this functionality?

도움이 되었습니까?

해결책

I did this by having my detail view controller embedded in a uinavigationcontroller. After creating the QLPreviewController I just pushed the view controller on to the navigation controller.

In the detail view controller:

QLPreviewController *previewController = [[QLPreviewController alloc] init];
[previewController setDataSource:self];
[previewController setDelegate:self];
[self.previewItem setTitle:item.name];
[self.navigationController pushViewController:previewController animated:NO];

The detail view controller also uses the QLPreviewControllerDelegate

- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
    return 1;
}

- (id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index {
    return self.previewItem;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top