0

I've got an UIImageView and in the same view I've got an UITableView.

I need to get the scroll y movement and the movement should update the height of UIImageView.

So if I scroll up the UITableView, the UIImage should reduce the height, if I scroll it down, the UIImage should increment its height.

I've already implemented the methods scrollViewWillBeginDragging and scrollViewDidScroll delegating <UIScrollviewdelegate>, I've tried to work with tableview.contentOffset.y, but The scroll is less than the reduce of UIImageView's height.

It should be a 1:1, so if I scroll up the Tableview for 20px, UIImage.frame.size.height -= 20.

EDIT:

Here's the code:

Here I get the starting point of dragging

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {

initialframe = _DetailViewTable.contentOffset.y; NSLog(@"Will begin dragging %f", initial frame);

}

In this method I should update the height, but i don't know how to do it.

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

    NSLog(@"%f",     initialframe-_DetailViewTable.contentOffset.y);`

//Here I update UIImageView's height, but it doesn't work properly.

_imageView.frame = CGRectMake(_imageView.frame.origin.x, , _imageView.frame.size.width, _imageView.frame.size.height-(initialframe-_DetailTab));

}

Bellots
  • 1,703
  • 3
  • 19
  • 29
  • Post the actual relationships between the UIImageView and UITableView. I.E. if they are subviews of a container UIView, if they are owned by a single UIViewController or UITableViewController, etc. – Idles Jun 20 '13 at 01:17
  • They are part of the same view, 2 separated levels..I've got the uiimageview back and in front I've got the uitableview. Was this the answer that you needed? – Bellots Jun 20 '13 at 01:20
  • At start height of the imageview and height of the tableview's content are equal? Or height of the imageview is equal to height of the tableview? I try imagine image on screen when doing scroll up and down. Height of your imageview have to tend to 0 for scrolling up? – stosha Jun 20 '13 at 01:56
  • 1
    add your code for reference..... – NANNAV Jun 20 '13 at 04:17

0 Answers0