UIWebView loadHTMLString:baseURL 方法不起作用

发布于 2024-10-07 09:34:40 字数 215 浏览 1 评论 0原文

我想使用这个在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

属性 2024-10-14 09:34:40

试试这个

<代码>
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];

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文