在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。我哪里错了?