2
UIDocumentInteractionController *documentController;
-(void)openDocumentIn
{
NSString *filepath = [[NSBundle mainBundle]pathForResource:@"Learn Book" ofType:@"pdf"];
NSLog(@"path:%@", filepath);
if(filepath == nil)
{
NSLog(@"filepath is nil.");
return ;
}
documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filepath]];
documentController.delegate = self;
documentController.UTI = @"com.adobe.pdf";
CGRect navRect = self.navigationController.navigationBar.frame;
navRect.size = CGSizeMake(1500.0f, 40.0f);
[documentController presentOpenInMenuFromRect:navRect inView:self.view animated:YES ];
//[documentController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES ];
}
我已經將它從「CGRectZero」更改爲「navRect」,但運行後沒有看到差異。爲什麼?presentOpenInMenuFromRect的第一個參數是什麼意思?
恰恰相反,'CGRectZero'通常工作正常 –