1
내 분할보기 컨트롤러에서 왼쪽의 테이블보기에 문서 목록이 있습니다. 사용자가 문서를 선택하면 오른쪽의 상세보기에 문서를 표시하려고합니다. 그러나 문서를 선택하면 documentInteractionController가 전체 화면을 차지하게됩니다. Detail View의 크기와 어떻게 일치시킬 수 있습니까?자세히보기에서 UIDocumentInteractionController 표시
- (void)viewDidLoad
{
[super viewDidLoad];
self.splitViewController.delegate = self;
}
-(void)viewWillAppear:(BOOL)animated
{
if (self.selectedUserDoc) {
NSURL *url = [[NSBundle mainBundle] URLForResource:self.selectedUserDoc.userDocTitle withExtension:@"pdf"];
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:url];
[self.documentInteractionController setDelegate:self];
[self.documentInteractionController presentPreviewAnimated:YES];
}
}
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller {
return self;
}
-(UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
return self.view;
}
-(CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
return self.view.frame;
}