From c50c9aee9620242e213d0827b3c7c19075a03c46 Mon Sep 17 00:00:00 2001 From: Andrea Mazzini Date: Fri, 28 Nov 2014 10:41:37 +0100 Subject: [PATCH] Fixed positioning when the navbar is hidden --- AMWaveTransition/AMWaveTransition.m | 6 +++++- Demo/Demo/Base.lproj/Main.storyboard | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AMWaveTransition/AMWaveTransition.m b/AMWaveTransition/AMWaveTransition.m index 8cbef95..2621514 100644 --- a/AMWaveTransition/AMWaveTransition.m +++ b/AMWaveTransition/AMWaveTransition.m @@ -246,6 +246,8 @@ - (void)animationCompletionForInteractiveTransitionForView:(UIView *)view UINavigationController *navigationController = self.navigationController; if (navigationController.navigationBar.translucent && !navigationController.navigationBar.hidden) { rect.origin.y -= navigationController.navigationBar.frame.origin.y + navigationController.navigationBar.frame.size.height; + } else { + rect.origin.y -= [[UIApplication sharedApplication] statusBarFrame].size.height; } view.frame = rect; view.alpha = [self alphaForView:view]; @@ -265,8 +267,10 @@ - (void)kickCellOutside:(UIView *)view CGRect rect = view.frame; rect.origin.x = -SCREEN_WIDTH - self.viewControllersInset; UINavigationController *navigationController = self.navigationController; - if (navigationController.navigationBar.translucent) { + if (navigationController.navigationBar.translucent && !navigationController.navigationBar.hidden) { rect.origin.y += navigationController.navigationBar.frame.origin.y + navigationController.navigationBar.frame.size.height; + } else { + rect.origin.y += [[UIApplication sharedApplication] statusBarFrame].size.height; } view.alpha = [self alphaForView:view]; view.frame = rect; diff --git a/Demo/Demo/Base.lproj/Main.storyboard b/Demo/Demo/Base.lproj/Main.storyboard index 09f870c..5ac369d 100644 --- a/Demo/Demo/Base.lproj/Main.storyboard +++ b/Demo/Demo/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - +