如何在iphone中设置html + css添加
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0,320,458)];
webView.delegate=self;
[self.view addSubview:webView];
// HTML files are stored in the main bundle
NSBundle *bundle = [NSBundle mainBundle];
NSString *path = [bundle bundlePath];
NSString *filename = @"index";
NSString *fullPath = [NSBundle pathForResource:filename ofType:@"html" inDirectory:path];
[fullPath stringByReplacingOccurrencesOfString:@"/" withString:@"_"];
// load a HTML from a file
// NSString *chapter_filename = [NSString stringWithFormat:@"Section%@", filename];
// NSString *sectionHTMLPath = [[NSBundle mainBundle] pathForResource:fullPath ofType:@"html"];
NSString* htmlContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:nil];
// add a generic template and …Run Code Online (Sandbox Code Playgroud)