我想在iOS8 Objective C中的Web视图中更改UIWebBrowserView的UIColor 请帮帮我 谢谢。
答案 0 :(得分:2)
使用此代码
UIWebView * webView_article = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 200, 400)];
webView_article.backgroundColor =yourClolor;
webView_article.delegate=self;
webView_article.scrollView.bounces = NO;
webView_article.scrollView.showsVerticalScrollIndicator = NO;
webView_article.scrollView.delaysContentTouches = NO;
webView_article.scrollView.delegate = self;
[webView_article setTag:11];
[webView_article setOpaque:NO];
你必须将setOpaque设置为No
答案 1 :(得分:0)
UIWebView *web = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
web.backgroundColor = [UIColor colorWithRed:32.0/255.0 green:32.0/255.0 blue:32.0/255.0 alpha:0.5];
web.delegate=self;
web.scrollView.bounces = NO;
web.scrollView.showsVerticalScrollIndicator = NO;
web.scrollView.delaysContentTouches = NO;
web.scrollView.delegate = self;
[web setOpaque:NO];
-(void)webViewDidStartLoad:(UIWebView *)webView{
[SVProgressHUD showWithStatus:@"Loading..." ];
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
NSLog(@"start ...");
}
-(void)webViewDidFinishLoad:(UIWebView *)webView {
[SVProgressHUD dismiss];
NSLog(@"finish");
}
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
[SVProgressHUD dismiss];
NSLog(@"Error for WEBVIEW: %@", [error description]);
}