开发者

Using HTML pages in UIWebView, strange issues with relative page images but links work

开发者 https://www.devze.com 2023-01-28 01:51 出处:网络
So I\'m creating an app which basically is a UIWebView that loads an HTML page, which should have images on it.The HTML page is loading fine (confirmed with a little text on the page), but then I have

So I'm creating an app which basically is a UIWebView that loads an HTML page, which should have images on it. The HTML page is loading fine (confirmed with a little text on the page), but then I have this code in it:

<img src="images/image_1.png">
 <a href="images/image_1.png">test</a>

Check this开发者_C百科 out:

  • The tag has a broken image link
  • But, when I tap on the link, the image loads!

How is this happening? What kind of solution is there?

I have the images in a subfolder of resources, which I added by "Create Folder References."

Help? A note: This is on iPad, using 4.2. But that shouldn't matter, right Apple? (Also, changing it to xml <img /> type tag doesn't do anything)


The image was way too big - over 2500px wide. Resizing to 1024px fixed it. Thanks Jose Vega.

Also, Automator is a gift from the Gods when it comes to batch operations.

0

精彩评论

暂无评论...
验证码 换一张
取 消