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

strange animation when increasing contentInset #85

Closed
kyfxbl opened this issue Jul 18, 2015 · 8 comments
Closed

strange animation when increasing contentInset #85

kyfxbl opened this issue Jul 18, 2015 · 8 comments

Comments

@kyfxbl
Copy link

kyfxbl commented Jul 18, 2015

hi james,

i use CSStickyHeaderFlowLayout for parallax CollectionView, and i add a pulling-to-refresh component on this UICollectionView. and after pulling, there is a strange animation. for clear shown, i set the animation duration to 3 seconds.

stackoverflow

and i setup a sample project, and email to you, thanks a lot @jamztang

@jamztang
Copy link
Collaborator

It'd be good if you can create an opensource project on github so everyone comment and help


Sent from Mailbox

On Sat, Jul 18, 2015 at 8:46 PM, kyfxbl notifications@github.com wrote:

hi james,
i use CSStickyHeaderFlowLayout for parallax CollectionView, and i add a pulling-to-refresh component on this UICollectionView. and after pulling, there is a strange animation. for clear shown, i set the animation duration to 3 seconds.
stackoverflow

and i setup a sample project, how can i send it to you? thanks @jamztang

Reply to this email directly or view it on GitHub:
#85

@kyfxbl
Copy link
Author

kyfxbl commented Jul 18, 2015

ok, do it now

@kyfxbl
Copy link
Author

kyfxbl commented Jul 18, 2015

@jamztang
Copy link
Collaborator

Let me know if that works for you @kyfxbl, then I'll push to CocoaPods

@jamztang jamztang reopened this Jul 18, 2015
@kyfxbl
Copy link
Author

kyfxbl commented Jul 19, 2015

@jamztang awesome, now it works fine :) thanks in advance

by the way, maybe you have noticed that, i use masonry for auto layout within SupplementaryView, otherwise the header couldn't be sticky: the SupplementaryView shrinked, but its subviews remain there. so i want to know, if it's best practice (or only right way) to use auto layout accompany with CSStickyHeaderFlowLayout?

the wrong code, header won't be sticky:

UILabel *header1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 375, 50)];
header1.backgroundColor = [UIColor yellowColor];
header1.text = @"1111";

UILabel *header2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, 375, 50)];
header2.backgroundColor = [UIColor blueColor];
header2.text = @"2222";

@jamztang
Copy link
Collaborator

Yes you'll have to setup your autolayout or autoresizing mask for that. The mechanism behind CSStickyParallaxHeader is that the library will handle the origin and height of the header for you, that means the origin is always sticks to the top and adding height to accommodate the visible areas. So if you don't setup how the subviews will "flow" inside the supplementary view, you won't get the desire result. How ever if you do it correctly, the possibilities are endless, like the few different apps I made and showcases in the readme.

One reminder is that It's important to configure the parallaxHeaderMinimalReferenceSize as well so it'll "push" away the header at desired point.

There's also another "sticky section header" that the library provides, it's like ordinary section headers in collection view and table views, but it tried to "stick" just below the parallax header.

Hope that explains.

@kyfxbl
Copy link
Author

kyfxbl commented Jul 19, 2015

got it, thank you very much. so i close the issue, amazing lib!

@kyfxbl kyfxbl closed this as completed Jul 19, 2015
@jamztang
Copy link
Collaborator

No problem, glad to help!


Sent from Mailbox

On Sun, Jul 19, 2015 at 8:05 PM, kyfxbl notifications@github.com wrote:

got it, thank you very much. so i close the issue, amazing lib!

Reply to this email directly or view it on GitHub:
#85 (comment)

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