I have a UIWebView
and I am just displaying some text. I am using html text to format the UIWebView
. How can I include a image/UIImage
inside it? I need to display an image with a fixed frame.
Asked
Active
Viewed 1,160 times
-2

katzenhut
- 1,742
- 18
- 26

Rory Lester
- 2,858
- 11
- 49
- 66
-
http://stackoverflow.com/questions/5329648/display-local-uiimage-on-uiwebview – Paresh Navadiya Jul 04 '12 at 10:58
-
At least add a title to your question... – Kanan Vora Jul 04 '12 at 11:12
1 Answers
5
Use img
tag. Inject this in your HTML code & render it in UIWebView
.
This should help -
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]]];

Srikar Appalaraju
- 71,928
- 54
- 216
- 264