您的位置:首页 > 其它

怎样合理布署微软产品?

2009-05-13 09:45 197 查看
自定义UIWebView背景和每段首行缩进
让UIWebView背景透明的方法,如下。

web_about.backgroundColor = [UIColor clearColor];
web_about.opaque = NO;

关键是在HTML里:
<body style="background-color: transparent">

//可以这样定义背景.
NSMutableString *string = [[[NSMutableString alloc] initWithString:htmlString] autorelease];
[string insertString:@"<body style=\"background-color:#FCF3E9;text-indent:2em;\">" atIndex:0];
[string appendString:@"</body>"];
NSLog(@"%@",string);
[webView loadHTMLString:string baseURL:nil];

#FCF3E9 可以通过取色器获得(该色为米黄色)
text-indent:2em 设置所有段落的首行缩进2格.
加载数据的时候,webView会显示一个白色的背景框,要去掉该框,我的做法是先将webView的frame设为Zero,在delegate的加载完成后再将frame设为原来大小.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: