Iphone 在UIWebView中显示图像
我想在UIWebView中使用Iphone 在UIWebView中显示图像,iphone,cocoa-touch,uiwebview,bundle,Iphone,Cocoa Touch,Uiwebview,Bundle,我想在UIWebView中使用 <img src="imageInBundle.png"/> 然而,我只得到一个带有白色问号的蓝色方框。我还需要做些什么吗?您为什么不使用UIImageView来显示此图像?尝试更改 [NSURL URLWithString: @"http://www.abc.com"] 到 路径是什么 NSString *path = [[NSBundle mainBundle] bundlePath]; …取决于图像的放置位置。如何动态执行嵌入字符串中的UI
<img src="imageInBundle.png"/>
然而,我只得到一个带有白色问号的蓝色方框。我还需要做些什么吗?您为什么不使用
UIImageView
来显示此图像?尝试更改
[NSURL URLWithString: @"http://www.abc.com"]
到
路径是什么
NSString *path = [[NSBundle mainBundle] bundlePath];
…取决于图像的放置位置。如何动态执行嵌入字符串中的UIImageView?我不是真的想这么做。
[NSURL fileURLWithPath:path]
NSString *path = [[NSBundle mainBundle] bundlePath];