ColinEberhardt / VCTransitionsLibrary

A collection of iOS7 animation controllers and interaction controllers, providing flip, fold and all kinds of other transitions.
Other
4.55k stars 617 forks source link

Cards animation with UINavigationController incorrect offset #5

Open BobDG opened 11 years ago

BobDG commented 11 years ago

The cards animation works but my final view has an incorrect offset of 30px that hides behind the navigation bar (a NOT-translucent navigation bar).

My guess is it has something do with: [UIView addKeyframeWithRelativeStartTime:0.6f relativeDuration:0.2f animations:^{ toView.frame = CGRectOffset(containerView.frame, 0.0, -30.0); }]; As here I see a -30 px offset..

ColinEberhardt commented 11 years ago

Thanks very much for pointing out this issue - I'll see if I can fix it,

tnewton42 commented 11 years ago

I'm seeing a similar issue; specifically, when view A pushes to view B within a UINavigationController, view B renders correctly. However, when view B is popped and view A is restored, view A's constraints don't take the navigation bar into consideration so that the top layout guide appears at the top of the view rather than being offset by the navigation bar.

I've played around by testing whether or not [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey] is in fact a UINavigationController and adjusting the frame accordingly, but this is not an ideal solution, especially if you have a background image that was originally underneath the navigation bar (as it will now be offset as well).