2

I want to make my webview to look transparent and show the data on it with background showing images of parent view.

Can anyone please let me know how to do this?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Jigar Pandya
  • 6,004
  • 2
  • 27
  • 45

3 Answers3

4

it may be help to u

[webView setOpaque:NO]; 
webView.backgroundColor = [UIColor clearColor];
Devin Burke
  • 13,642
  • 12
  • 55
  • 82
Nag_iphone
  • 967
  • 7
  • 22
2

Following code is use for solve your problem

    NSString *htmlData=@"your data string here";

    [self.webVctr loadHTMLString:strForhtmldata baseURL:nil];

now webview transparent for that following code to use.

    self.webVctr.opaque = NO;
    self.webVctr.backgroundColor = [UIColor clearColor];
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Nimit Parekh
  • 16,776
  • 8
  • 50
  • 72
-2

UIWebView is a subclass of UIView, which means you can set its backgroundColor property to a transparent UIColor:

myWebview.backgroundColor = [UIColor clearColor];
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345