Skip to content

Instantly share code, notes, and snippets.

@guange2015
Created April 24, 2012 09:02
Show Gist options
  • Save guange2015/2478082 to your computer and use it in GitHub Desktop.
Save guange2015/2478082 to your computer and use it in GitHub Desktop.
- (void)viewDidLoad
{
[super viewDidLoad];
[webView setBackgroundColor:[UIColor clearColor]];
[self hideGradientBackground:webView];
[webView loadHTMLString:@"This is a completely transparent UIWebView. Notice the missing gradient at the top and bottom as you scroll up and down." baseURL:nil];
}
- (void) hideGradientBackground:(UIView*)theView
{
for (UIView * subview in theView.subviews)
{
if ([subview isKindOfClass:[UIImageView class]])
subview.hidden = YES;
[self hideGradientBackground:subview];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment