【发布时间】:2013-03-26 11:58:20
【问题描述】:
我正在处理资源文件夹中的显示 PDF
在UIScrollview。但无法添加。
我在ViewController 上添加UIScrollView。然后获取UIImageView 并添加UIScrollView 作为下面的代码。
scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0, 0.0,768,1024)];
scrollView.contentSize = CGSizeMake(768,2000);
scrollView.delegate = self;
scrollView.pagingEnabled = NO;
[self.view addSubview:scrollView];
UIImageView *img=[[UIImageView alloc] initWithFrame:CGRectMake(00, 20, 500,900)];
NSString *url = [[NSBundle mainBundle]pathForResource:@"Acknowledgements" ofType:@"pdf"];
img.image=[UIImage imageWithContentsOfFile:url];
[scrollView addSubview:img];
但 pdf 没有添加到滚动视图上。如果我添加一些图像文件,例如
NSString *url = [[NSBundle mainBundle]pathForResource:@"trophy" ofType:@"png"];
它被添加。 PDF 文件正确并在 Mac 中打开。 PPT文件也会出现同样的情况。
出了什么问题。 谢谢
【问题讨论】:
-
将其添加到 uiwebview ...
-
检查此链接。您可以使用 uiwebview。 stackoverflow.com/questions/2890246/…
标签: iphone uiscrollview uiimageview