0

I a uiimage that I use as cover photo, and I want to use the scroll view to pull down and enlarge but I want the top of the image to stay on top:

enter image description here

and this is the method:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView;{

    CGFloat offset = scrollView.contentOffset.y;
    offset = offset + 54;


    if (offset < 0 && offset > -25) {
        _coverImageView.frame = CGRectMake(offset, 0,320 + (-offset) * 2, 150 + (-offset));
    }

    NSLog(@"%f", offset);
}

tnx

JohnBigs
  • 2,691
  • 3
  • 31
  • 61

1 Answers1

0

You can use imageview behind the scrolview with clear background and resize while scrolling according to offset.

  OR

This may help https://www.cocoacontrols.com/controls/secret-viewer

Zahid
  • 552
  • 3
  • 11