简体   繁体   中英

iPhone img tag in local html file

I have an image that is set to content and is in the root of the bundle. I have verified it is there in the simulator.

When I construct HTML to display in the UIWebView, this HTML fails to show the image:

Is there a relative path it should be in?

Note: I use the bundle as the base path in the call to show the html.

(I use MonoTouch) NSUrl path = new NSUrl (NSBundle.MainBundle.BundlePath);

Not sure how MonoTouch plays with URL's, but since it's built atop NSUrl you probably still need to do something like this:

NSURL *myUrlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];

You can't just use the plain NSURL constructor...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM