iOS--UIWebView设置backgroundColor无效问题

xiaoxiao2021-02-27  156

问题:

UIWebView设置backgroundColor无效问题

解决办法:

//网页加载器 UIWebView *webView = [[UIWebView alloc] init]; webView.opaque = NO;//重要 webView.backgroundColor = [UIColor blueColor]; webView.scrollView.scrollEnabled = NO; self.webView = webView; webView.delegate= self;

就是要加上webView.opaque = NO;这样设置backgroundColor才有效果

转载请注明原文地址: https://www.6miu.com/read-15820.html

最新回复(0)