我试图在UIWebView中加载PDF,但PDF格式全屏PDF可以在写右手边显示在UIWebView的
如何让全屏幕显示
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)];
//webView.contentMode = UIViewContentModeScaleAspectFit;
NSString *path = [[NSBundle mainBundle] pathForResource:@" manual" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
CGRect frame = webView.frame;
// you may need to modify the 5 and 10 below to match the size of the PDF border
frame.origin.x = frame.origin.x - 5;
frame.origin.y = frame.origin.y - 5;
frame.size.width = frame.size.width + 100;
frame.size.height = frame.size.height + 100;
webView.frame = frame;
[webView loadRequest:request];
[self.view addSubview:webView];
[webView release];
你可以把你得到的一个截图 – 2011-03-24 10:50:27