开发者

Browsing through folders in a UIWebView

My question is the following. I'm a bit confused about the path of resources to be loaded in a UIWebView. I'ld like to make my links active. For the moment the WebView isn't getting resources (.css, .html) that are in other folders while the link between them is correct. Do you know how to fix t开发者_如何学Pythonhis ? I'm currently doing like this

NSString* path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; NSString* htmlString = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; [WebView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:path]];

Thanks for reading me !


Can you try like this, it may be useful:

[webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"webPage" ofType:@"html"]]]];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜