我正在使用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;
}