Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setParallaxHeaderView multiple times using UIScrollView doesn't work #29

Open
cerupcat opened this issue Oct 20, 2015 · 3 comments
Open

Comments

@cerupcat
Copy link

I'm trying to update the view and height of a parallaxHeader. I'm calling setParallaxHeaderView every time to update it (since I don't see another method). However, when you try and call setParallaxHeaderView on a scrollView more than once, the offsets aren't taken into account and the header keeps moving down the page. I'm not exactly sure how to fix this or update/change the view and height.

You can test this by putting this in viewDidLoad of UIScrollView example:

 HeaderView *headerView = [HeaderView instantiateFromNib];

    [self.scrollView setParallaxHeaderView:headerView
                                      mode:VGParallaxHeaderModeCenter
                                    height:200];

    // Delay execution of my block for 10 seconds.
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{

        HeaderView *headerView = [HeaderView instantiateFromNib];
        [self.scrollView setParallaxHeaderView:headerView
                                          mode:VGParallaxHeaderModeCenter
                                        height:200];
    });


    // Delay execution of my block for 10 seconds.
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{

        HeaderView *headerView = [HeaderView instantiateFromNib];
        [self.scrollView setParallaxHeaderView:headerView
                                          mode:VGParallaxHeaderModeCenter
                                        height:200];
    });

    // Delay execution of my block for 10 seconds.
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{

        HeaderView *headerView = [HeaderView instantiateFromNib];
        [self.scrollView setParallaxHeaderView:headerView
                                          mode:VGParallaxHeaderModeCenter
                                        height:200];
    });
@maxep
Copy link

maxep commented Oct 28, 2015

Hi @cerupcat

I've seen this too and I've started a fix on my fork, but I didn't go deeper...

@cerupcat
Copy link
Author

cerupcat commented Nov 3, 2015

Thanks @maxep. I'm using your MXSegmentedPager and it looks like you're using your repo version for this so that'll fix my issue. :)

@cerupcat
Copy link
Author

cerupcat commented Nov 3, 2015

Actually, @maxep it looks like MXSegmentedPager isn't using your fork and therefore it has the same issue. Any chance of updating to use your fork instead? I'll make a ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants