开发者

Images not shown in my iphone web app

I'm creating a web app and have a probl开发者_运维知识库em. My images is shown in my Safari browser and in the Iphone simulator, but they are not shown on my Iphone.

Any ideas?


If HTML files and images are stored locally on device, you have to keep in mid that iOS filesystem is case sensitive. so iPhone.jpg and iphone.jpg can be two different files... make sure that all your tags and corresponding files have correct case... Also when loading uiwebview and resources for it are in bundle folder you have to make sure that you set baseURL so that webkit can find relative linked files:

NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];

this enables you to link relative to bundle:

<img src=iPhone.jpg">
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜