简体   繁体   中英

Making the background of my UIWebView transparent failed

I am trying to make the background of my UIWebView transparent. I tried the things mentioned here: How to make a transparent UIWebView

well it works but only after I press a button on my webview, and is not transparent when it loads. I can't figure out why.

Well the problem was that I had put these messages in the function for the button.

  [self.webView setOpaque:NO];
  [self.webView setBackgroundColor:[UIColor clearColor]];

I put the in the viewDidLoad method and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM