Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试获取 UIWebView 的 UIImage,我可以使用 renderInContext: 来做到这一点。然而,在我生成图像之前,我想用一些 HTML 代码更新 UIWebView,诀窍是 UIWebView 是隐藏的。现在,我无法在 UIImage 中渲染 Web 视图的更新版本,只能使用旧版本。
您是否要等到 UIWebView 重新渲染后再查询它?将 HTML 加载到 UIWebView 不会立即更新视图。你需要等待webViewDidFinishLoad:。即使 HTML 是没有外部引用的简单字符串也是如此。
webViewDidFinishLoad: