UIWebView loadHTMLString:baseURL 方法不起作用
我想使用这个在 UIWebView 中显示本地 html 字符串内容:
[webView loadHTMLString:value baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
我不知道出了什么问题,但 Web 视图仍然是白色的,
谢谢帮助
I want to show a local html string content in a UIWebView using this :
[webView loadHTMLString:value baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
I dont know what's going wrong, but the web view remains white
thank's for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个
<代码>
NSString *html = [[NSString alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"document" ofType:@"html"]];
[webView loadHTMLString:html baseURL:nil];
Try this
NSString *html = [[NSString alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"document" ofType:@"html"]];
[webView loadHTMLString:html baseURL:nil];