Advertisement
priore

UIWebView transparent and scrollbar hidden

Mar 4th, 2013
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)webViewHideBackgroundAndScrollBar:(UIWebView*)theView {
  2.     theView.opaque = NO;
  3.     theView.backgroundColor = [UIColor clearColor];
  4.    
  5.     for(UIView *view in theView.subviews) {
  6.         if ([view isKindOfClass:[UIImageView class]]) {
  7.             // to transparent
  8.             [view removeFromSuperview];
  9.         }
  10.        
  11.         if ([view isKindOfClass:[UIScrollView class]]) {
  12.             UIScrollView *sView = (UIScrollView *)view;
  13.             //to hide Scroller bar
  14.             sView.showsVerticalScrollIndicator = NO;
  15.             sView.showsHorizontalScrollIndicator = NO;
  16.            
  17.             for (UIView* shadowView in [sView subviews]){
  18.                 //to remove shadow
  19.                 if ([shadowView isKindOfClass:[UIImageView class]]) {
  20.                     [shadowView setHidden:TRUE];
  21.                 }
  22.             }  
  23.         }  
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement