- Drag the resource into your xcode project (I dragged a folder named www from my finder window), you will get two options "create groups for any added folders" and "create folders references for any added folders".
- Select the "create folder references.." option.
-
Use the below given code. It should work like a charm.
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"]];
[webview loadRequest:[NSURLRequest requestWithURL:url]];
ios如何在项目中添加本地html文件,并解决无法加载图片、css、js的问题
最新推荐文章于 2022-05-23 09:28:48 发布