我在UIWebview中向我的应用程序添加了条款和条件。我真正想知道的是我可以逐页显示pdf文档还是应该使用其他方法? App Store会接受pdf格式吗?
最佳答案
是的,可以使用UIWebview
完成此操作,并且肯定会被Apple 接受。
如果您尝试从Web URL显示PDF文件,请使用以下代码。
NSURL *targetURL = [NSURL URLWithString:@"http://yourdomain.com/file_toopen.pdf"];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];
或者,如果您的应用程序中捆绑有PDF文件,请使用以下代码。
NSString *path = [[NSBundle mainBundle] pathForResource:@"filetoopen" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];
关于ios - 我们可以在IOS应用程序的UIWebview中将条款和条件以PDF格式加载吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35450438/