【发布时间】:2012-04-15 19:11:02
【问题描述】:
我有以下代码,它仅在 InfoViewController 中使用简单的 UIWebView 显示 pdf:
- (void)loadPDF
{
NSString *pathToInfoPDF = [[NSBundle mainBundle] pathForResource:@"info"
ofType:@"pdf"];
NSURL *pdfUrl = [NSURL fileURLWithPath:pathToInfoPDF];
NSURLRequest *pdfUrlRequest = [NSURLRequest requestWithURL:pdfUrl];
[self.pdfWebView loadRequest:pdfUrlRequest];
}
这是使用信息按钮作为模式视图呈现给用户的:
- (IBAction)showInfo:(id)sender
{
NSLog(@"Info Button pressed!");
InfoViewController *infoViewController = [[InfoViewController alloc]
initWithNibName:@"InfoViewController" bundle:nil];
infoViewController.delegate = self;
[self presentModalViewController: infoViewController animated: YES];
}
这在 iOS 5.0 及更高版本中效果很好:
但是,当我尝试在 iOS 4.3.2 中加载此页面时,页面未全屏显示:
有没有办法让使用 iOS 4.3 以及 iOS 5.0 及更高版本的设备全屏显示 pdf?还是我在 UIWebView 中显示 pdf 的方式有问题?
【问题讨论】:
标签: objective-c ios xcode pdf uiwebview