I have a new design for my application, and it includes parallax scrolling to display the image on top of the tableView.
I know how to add a parallax effect with placing an image in a cell, for example:
when calling the scrollViewDidScroll table:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint currentOffset = scrollView.contentOffset;
if (currentOffset.y > _lastContentOffset.y) {
_containerView.clipsToBounds = true;
_bottomSpaceConstraint.constant = -scrollView.contentOffset.y / 2;
_topSpaceConstraint.constant = scrollView.contentOffset.y / 2;
} else {
_topSpaceConstraint.constant = scrollView.contentOffset.y;
_containerView.clipsToBounds = false;
}
_lastContentOffset = currentOffset;
}
(_bottomSpaceConstraint and _topSpaceConstraint are the upper and lower image limits that are inside the tableView cell in section 0)
, , . ( ) , . , TableView, , . , , . , , .
android " ".
http://antonioleiva.com/collapsing-toolbar-layout/
- , " " iOS.
!