开发者

Iphone Open With in a UIWebView

is it possible开发者_如何转开发 to show a PDF in a UIWebView with the option Open in Books and Open With at the top of the WebView? I don't know how to do that.

Thanks


Put a UIDocumentInteractionController on top of the web view, it will allow the user to open the pdf in iBooks.


NSString * path = [[NSBundle mainBundle] pathforResource:@"ResourceName" ofType:@"pdf"] ; or path can be any http url too.

NSURL * url = [NSURL fileURLWithPath:path];

NSURLRequest * request = [NSURLRequest requestWithURL:url];

UIWebView * webView = ....;

[webView loadRequest:request];

This should show the pdf in webview. But seems you are asking to open the pdf in some other app, which part I didn't understand completely. Can you explain?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜