`

iphone开发 两种方式 UIWebView 显示 html

阅读更多

NSBundle* bundle = [NSBundle mainBundle];
NSString*  resPath = [bunder resourcePath];
NSString* filePath = [resPath stringByAppendPathComponent:@"test.html"];
 
[WebView loadHTMLString:[NSString stringWithContentsOfFile:filePath] baseURL:[NSURL fileURLWithPath:[bundle bundlePath]]];

 

 

NSString *fullPath = [NSBundle pathForResource:@"test" ofType:@"html" inDirectory:[[NSBundle mainBundle] bundlePath]];
	[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:fullPath]]];
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics