【发布时间】:2011-09-23 10:37:25
【问题描述】:
在我的应用中,
我在 webview 中打开一个 url,
但是在webview中打开一个url需要一些时间,
在那段时间内webview显示白色背景,
我想改变那个背景。
我试试
webView.backgroundColor=[UIColor blackColor];
它不适合我
那么,我该怎么做呢?
【问题讨论】:
标签: iphone objective-c cocoa-touch ios4 webview
在我的应用中,
我在 webview 中打开一个 url,
但是在webview中打开一个url需要一些时间,
在那段时间内webview显示白色背景,
我想改变那个背景。
我试试
webView.backgroundColor=[UIColor blackColor];
它不适合我
那么,我该怎么做呢?
【问题讨论】:
标签: iphone objective-c cocoa-touch ios4 webview
创建时
[webView setBackgroundColor:[UIColor clearColor]];
[webView setBackgroundColor:[UIColor purpleColor]];
[webView setOpaque:NO];
- (void)webViewDidFinishLoad:(UIWebView *)webView{
[webView setOpaque:YES];
[webView setBackgroundColor:[UIColor whiteColor]];
}
【讨论】:
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
webView.backgroundColor=[UIColor whiteColor];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
webView.backgroundColor=[UIColor blackColor];
}
【讨论】: