我想在我的应用程序中添加一个可以水平滚动的pdf查看器。谁知道怎么做?我正在做几次尝试,但没有成功。谢谢。利玛
答案 0 :(得分:0)
横向使用UIWebViewController,这段代码可以让您了解如何显示pdfs:
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake( 0, 0, 320, 480 )];
NSString *path = [[NSBundle mainBundle] pathForResource:@"about" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];
webView.scalesPageToFit = YES;
[self.view addSubview:webView];
[webView release];