Im trying to reproduce the screen resizing behavior displayed in iOS Rdio app. The screen in question gives an overview of the selected album and contains a UIView in the upper half and a UITableView in the lower half. When the View table scrolls, it first resizes up to fill the screen, and then starts scrolling its contents as soon as the maximum height is reached.
After some searching, I found this question: Dragging and dropping a UITableView , which basically ask for the same thing, however its accepted method is the same as my original thoughts and trial versions, which was to use UIPanGestureRecognizer and resize the table height according to the translation of the pan.
This means that it does not provide the behavior I'm looking for. Using this method allows you to statically drag the table height up or down, and it has an added panGesture problem that overrides the tableViews function, which then prevents the content from scrolling.
The modified behavior of the functions of the Rdio application and feels just like a UIScrollView, it has inertia. You can drag it all the way, click up or down and it resizes smoothly. When the tableView reaches its full-size or original half-size, the remaining inertia is apparently transmitted in the form of a table, causing the cells to scroll as usual for this amount. I know that they have to manipulate UIScrollViews, I just can't figure out how to do this.
As a final note, in the end, I will use AutoLayout on this screen, so I'm wondering how this could potentially interfere or help in this situation.
Update
This approach has brought me closer to the behavior that I'm still looking for. Clicking the View table up behaves exactly the way I wanted (resizing with inertia and continuing to scroll when I reach the maximum height), although with less sensitivity than I would like. However, clicking down does not provide inertia and instantly stops.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGRect scrollViewFrame = scrollView.frame; CGFloat scrollViewYOffset = scrollView.contentOffset.y; if (scrollViewFrame.origin.y <= kTableViewMaxYOrigin || scrollViewFrame.origin.y <= _originalTableViewFrame.origin.y) { scrollViewFrame.origin.y -= scrollViewYOffset; if(scrollViewFrame.origin.y >= kTableViewMaxYOrigin && scrollViewFrame.origin.y <= _originalTableViewFrame.origin.y) { scrollViewFrame.size.height += scrollViewYOffset; scrollView.frame = scrollViewFrame; scrollView.contentOffset = CGPointZero; } } }