user interface - Load Content in the UIWebView on the Iphone -
Hello, I would like to show the content in UIWebView, which I have added to the project. For example, an image I know is how to set a text in UIWebView, but I would like to add images or videos that I have added to the project
Best regards,
< Okay, I believe that you set your HTML on UIWebView to
.
To reference images stored in your app bundle, you need to get the right path to keep in your IMG tag. Get path string:
NSString * imgPath = [[NSBundle main bundle] Pathfoser resource: nameOfImage ofType: @ "jpg"];
Some HTML formats with an image tag:
NSString * html = NSString [[[NSString alloc] initWithFormat: @ "& lt; img src = \ "File: //% @ \" /> ", IMGpath] AutoWrecks];
Then set your HTML on the web view:
[self.webView loads HTML string: html baseURL: zero];
You need to add images to your app resources (in the code above nameOfImage ) and it will work fine.
Comments
Post a Comment