1

我的应用程序的功能之一是在 UIWebView 中呈现 PDF 文件(来自应用程序包)。

在我的 iPhone 上它工作正常,但我有一些报告说在其他设备上没有显示 PDF 文件。

可能是什么问题呢?这可能与这些设备上的 iOS 版本有关吗?

这就是我在应用程序中呈现文件的方式:

NSString *pdfPath = [[NSBundle mainBundle] pathForResource:self.fileName ofType:@".pdf"];
if (!pdfPath) {
    Helper* h = [[Helper alloc]init];
    pdfPath = [h filesinADocumentFolder:self.fileName];
}

self.pdfUrl = [NSURL fileURLWithPath:pdfPath];
[self.webView1 loadRequest:[NSURLRequest requestWithURL:pdfUrl]];
[self.webView1 setBackgroundColor:[UIColor clearColor]];
[self.webView1 setOpaque:NO];
4

0 回答 0