Ios5 PresentOpenMinumeFromRect的第一个参数是什么意思?
我已经将它从“CGRectZero”改为“navRect”,但运行后看不出有什么区别。为什么?的第一个参数是定位菜单的位置(在视图坐标系中) 执行“Ios5 PresentOpenMinumeFromRect的第一个参数是什么意思?,ios5,Ios5,我已经将它从“CGRectZero”改为“navRect”,但运行后看不出有什么区别。为什么?的第一个参数是定位菜单的位置(在视图坐标系中) 执行“CGRectZero”将不起作用,因为这意味着您要求的是高度和宽度为零的矩形。而整个导航栏(就像你在上面的“navRect”中所做的那样)也不会起作用 最好将矩形设置为显示在触发UIDocumentInteractionController的按钮下方或旁边 UIDocumentInteractionController *documentContro
CGRectZero
”将不起作用,因为这意味着您要求的是高度和宽度为零的矩形。而整个导航栏(就像你在上面的“navRect
”中所做的那样)也不会起作用
最好将矩形设置为显示在触发UIDocumentInteractionController
的按钮下方或旁边
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 ];
}