PDF在iOS中使用horinzontally在UIWebView中读取

时间:2014-05-23 04:36:34

标签: ios uiwebview

在iOS中水平阅读UIWebView中的PDF文件。

所以我写下以添加UIScrollView来水平滚动。

UIScrollView *scrollView = [[UIScrollView alloc] init];
    scrollView.contentSize = CGSizeMake(2000, 420);
    scrollView.bounces = NO;
    scrollView.alwaysBounceHorizontal = NO;
    scrollView.alwaysBounceVertical = NO;
    scrollView.backgroundColor = [UIColor whiteColor];

    [scrollView addSubview:self.spiderWeb];

    NSString *path = [[NSBundle mainBundle] pathForResource:@"document" ofType:@"pdf"];
    NSURL *targetURL = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
    [self.spiderWeb loadRequest:request];

    [self.view addSubview:scrollView];

它没有显示任何内容。没有ScrollView,我可以垂直阅读UIWebView中的PDF。我哪里错了?