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,我只是显示一些文本。我正在使用 html 文本来格式化UIWebView. 我怎样才能image/UIImage在其中包含一个?我需要显示具有固定框架的图像。
UIWebView
image/UIImage
使用img标签。将其注入您的 HTML 代码并以UIWebView.
img
这应该有帮助 -
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]]];