利用该法典将html装上背景图像。
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"bgfull.png"];
NSURL *url = [[NSURL alloc] initFileURLWithPath:path isDirectory:NO];
NSString *size = [@"100%25" stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *contentHtml = [NSString stringWithFormat:@"<html>
<head>
<style type="text/css">
html {height:%@;}
body {height:%@; margin:0; padding:0; color:white; font-size:40px;}
#bg {position:fixed; top:0; left:0; width:%@; height:%@;}
#content {position:relative; z-index:1;}
</style>
</head>
<body>
<div id="bg"><img src="%@" width="%@" height="%@"></div>
<div id="content"><font color="#DAF899" size="+4"><b>%@</b></font><p>%@</p></div>
</body>
</html>", size, size, size, size, url, size, size, self.navigationItem.title, content];
[webView loadHTMLString:contentHtml baseURL:nil];
希望这一帮助。