UIWebView showing blank screen in iOS 8

こ雲淡風輕ζ 提交于 2019-11-29 09:36:41

It's an iOS 8 bug! You can work around it using:

NSString *string = [[NSBundle mainBundle] pathForResource:@"Low Cost Perimeter Build Guide" ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:string];
NSData *pdfData = [[NSData alloc] initWithContentsOfURL:url];
[self.webView loadData:pdfData MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil];

Loading PDF in a UIWebView rendered a blank page in the iOS 8 beta builds.
I re-tested with the official iOS 8.0 release and it's working fine now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!