Skip to content

Creating parallax effect when scrolling layout. #14

@hrsalehi

Description

@hrsalehi

I have a layout with an image above it and I want to image scroll faster that the other view. Is this possible? I set the main view delegate UIScrollViewDelegate and in viewDidScroll can get the scroling action but the frame of subviews doesn't change

Assume I want to subview1 scroll with 2 times speed of normal scrolling:
(void)scrollViewDidScroll:(UIScrollView _)scrollView
{
float y = scrollView.contentOffset.y;
CGRect gallRect = _viewGallery.frame;
gallRect.origin.y = y_2;
_viewGallery.frame = gallRect;
}

but nothing happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions