detailView上的UIDocumentInteractionController

时间:2011-09-26 16:37:28

标签: ipad uidocumentinteraction

我正在使用UIDocumentInteractionController预览文件,但它占据了iPad的所有区域。我希望它出现在拆分视图控制器的详细视图中。我已经检查过我的视图控制器的UIView没有占据整个屏幕。有任何想法吗?我检查了documentInteractionControllerRectForPreview:被调用。

-(void)requestExecutedWithSuccess:(Model *)model {
    UIDocumentInteractionController *docInteractionCont = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:model.filePath]];
    self.docInteractionController = docInteractionCont;
    self.docInteractionController.delegate = self;
    BOOL attachmentShown = [self.docInteractionController presentPreviewAnimated:YES];
    ...
}

- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller {
    return [self navigationController];
}

- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
    return self.view;
}

- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
    return self.view.frame;
}

0 个答案:

没有答案