开发者

UIWebView locally save images and just load html

i want to load just the html fr开发者_运维知识库om the web and show the images from the local resource.

This helped me a lot, but is the path to the resource on every device the same? Or does it depend on an installation path or similar? Load Content in the UIWebView on the Iphone


the path to resources is different on every device, that's why you use the function

[[NSBundle mainBundle] pathForResource:nameOfImage ofType:@"jpg"]

the html loading from the web you can do all kinds of ways. The easiest is just:

NSString *myHTML = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://web.site.com/file.html"]];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜