每个 WebView 的 IWebPreferences

发布于 2024-10-09 12:04:16 字数 281 浏览 11 评论 0原文

我试图禁用某些 WebView 的图像自动加载,同时启用其他 WebView。但是,当我为 WebView 禁用它时,所有 WebView 都会停止加载图像。下面是我使用的代码:

IWebPreferences *prefs = NULL;
webView->preferences(&prefs);
prefs->setLoadsImagesAutomatically(false);
prefs->Release();

实现我的目标的正确方法是什么?

I am trying to disable image auto loading of some WebViews while I keep others enabled. However when I disable it for a WebView, all webviews stop loading image. Below is code I use:

IWebPreferences *prefs = NULL;
webView->preferences(&prefs);
prefs->setLoadsImagesAutomatically(false);
prefs->Release();

What is the proper way to accomplish my goal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

猫烠⑼条掵仅有一顆心 2024-10-16 12:04:16

只需使用 initWithIdentifier 为每个 Web 视图使用不同的标识符

Just use different identifier for each webview using initWithIdentifier

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