Skip to content

Instantly share code, notes, and snippets.

@priore
Created October 25, 2013 23:48
Show Gist options
  • Save priore/7163549 to your computer and use it in GitHub Desktop.
Save priore/7163549 to your computer and use it in GitHub Desktop.
UIWebView transparent and scrollbar hidden
- (void)webViewHideBackgroundAndScrollBar:(UIWebView*)theView {
theView.opaque = NO;
theView.backgroundColor = [UIColor clearColor];
for(UIView *view in theView.subviews) {
if ([view isKindOfClass:[UIImageView class]]) {
// to transparent
[view removeFromSuperview];
}
if ([view isKindOfClass:[UIScrollView class]]) {
UIScrollView *sView = (UIScrollView *)view;
//to hide Scroller bar
sView.showsVerticalScrollIndicator = NO;
sView.showsHorizontalScrollIndicator = NO;
for (UIView* shadowView in [sView subviews]){
//to remove shadow
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:TRUE];
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment