我正在使用 预览文件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;
}