2012-07-04 57 views
-2

我有一个UIWebView,我只是显示一些文本。我正在使用html文本格式化UIWebView。我如何在其中包含image/UIImage?我需要显示一个固定帧的图像。在UIWebView中添加图像

+0

http://stackoverflow.com/questions/5329648/display-local-uiimage-on-uiwebview –

+0

至少一个标题添加到您的问题... –

回答

4

使用img标记。将其注入您的HTML代码&,并将其渲染到UIWebView

这将有助于 -

NSString *html = @"<html><body style='margin:0;'><img width='300' height='300' src='my_test_image.jpg'></body></html>"; 
[web loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];