Try adding an overlay view as a subset of the scroll and then refresh the overlay view frame as a scroll scroll.
Store original overlay frame in member variable during initialization
CGRect baseOverlayRect = overlayView.frame;
Scroll through the delegate method view.
- (void) scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint overlayOrigin = CGPointMake(baseOverlayRect.origin.x, baseOverlayRect.origin.y + scrollView.contentOffset.y);
CGRect newOverlayFrame = CGRectMake(overlayOrigin.x, overlayOrigin.y, baseOverlayRect.width, baseOverlayRect.height);
overlayView.frame = newOverlayFrame;
}
source
share