我想一个HTML字符串加载到一个UIWebView
。 HTML中包含一个iframe
,但它不会在web视图加载。
这里是我的代码,
webDescription = [[UIWebView alloc]initWithFrame:CGRectMake(0, 255,self.view.bounds.size.width, 20)];
[[webDescription scrollView] setBounces: NO];
webDescription.delegate = self;
NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<style type=\"text/css\"> \n"
"body {font-family: \"%@\"; font-size: %@; COLOR:#111111; background-color:transparent; padding:10px 5px 15px 20px;}\n"
"</style> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", @"MyriadPro-Regular", [NSNumber numberWithInt:12], _group.gro_content];
[webDescription setBackgroundColor:[UIColor clearColor]];
[webDescription setOpaque:NO];
[webDescription loadHTMLString:myDescriptionHTML baseURL:nil];
[scrollView addSubview:webDescription];
我怎样才能解决这个问题呢?