Skip to content

Instantly share code, notes, and snippets.

@0x30
Created November 13, 2017 05:36
Show Gist options
  • Save 0x30/94d939e3ebe9b4483587e6761488dc49 to your computer and use it in GitHub Desktop.
Save 0x30/94d939e3ebe9b4483587e6761488dc49 to your computer and use it in GitHub Desktop.
UIScrollerView Top screen backColor
-(void)setTopBackgroundColor:(UIColor *)color{
CGRect frame = self.bounds;
frame.origin.y = -CGRectGetHeight(UIScreen.mainScreen.bounds);
frame.size = UIScreen.mainScreen.bounds.size;
UIView* grayView = [UIView.alloc initWithFrame:frame];
grayView.backgroundColor = color;
[self addSubview:grayView];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment