<分区>
如何将图像添加到<p>
标签?在我的 html 数据中多个 <p>
标签。那么我如何设置不同的图像以在 UIWebView 中添加和使用。提前致谢
最佳答案
在 HTML 中添加图像:
<p><img src="yourawesomeimage.png" alt="Awesome!" /></p>
将 HTML 添加到 UIWebView:
NSString* htmlContent = @"<html><head><title></title></head><body><p><img src='image.jpg' /></p></body></html>";
[self.webView loadHTMLString:htmlContent baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
关于html - 如何将图像添加到 <p> 并在 UIWebView 中使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22405734/
相关文章:
ios - 使用 iOS UIWebView 时的 Rails 布局(application.html.erb)逻辑
javascript - 在一个 div 中居中一个 div
swift - 使用 iOS8 Swift XCode 6 通过 uiwebview 将新样式表注入(inject)网站
javascript - html/jquery 如何在 mouseenter 时将 div 悬停在其子项上
ios - 对多关系作为 sectionNameKeyPath