2
我在我的xcode项目中有一个本地html文件。但我无法使用UIWebView加载该本地HTML文件。在UIWebview中加载本地html文件
我在我的xcode项目中有一个本地html文件。但我无法使用UIWebView加载该本地HTML文件。在UIWebview中加载本地html文件
的代码来实现你的要求是:
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0,
self.view.frame.size.height,self.view.frame.size.width)];
NSString *indexPath = [NSBundle pathForResource:@"index" ofType:@"html" inDirectory:nil];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:indexPath]]];
[self.view addSubview:webView];
它可能是有用的,你快乐,请张贴一些代码 – 2011-06-15 12:20:52