recruit-mp / RMPZoomTransitionAnimator

A custom zooming transition animation for UIViewController
MIT License
1.71k stars 178 forks source link

Problem when navigation bar is not translucent #15

Open ManueGE opened 8 years ago

ManueGE commented 8 years ago

I have a problem using this library on a navigation controller with an opaque navigation bar. It seems the final frame is not calculated properly and the top side of the view is hidden by the navigation bar.

An example to reproduce this is just adding the following code in the viewDidLoad method in the NavigationController class in the provided example:

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.delegate = self;
    self.navigationBar.translucent = NO;
}

Any workaround for this?

galfaroth commented 8 years ago

BUMP, Having same issue!

galfaroth commented 8 years ago

Fixed by adding: toVC.view.frame = [transitionContext finalFrameForViewController:toVC]; above if(self.goingForward) in - (void)animateTransition:(id)transitionContext method.

ManueGE commented 8 years ago

Thanks, I'll give a try.

dani2906 commented 7 years ago

Having same issue :(

dani2906 commented 7 years ago

any other ideas?

mahmutpinarbasi commented 7 years ago

in RMPZoomTransitionAnimator.m in - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext method

if(![[UIApplication sharedApplication].keyWindow.subviews containsObject:toVC.view]) { [[UIApplication sharedApplication].keyWindow addSubview:toVC.view]; }

removing this line, fixes the invisible UINavigationBar issue for me.

mpon commented 7 years ago

Sorry, I have no enough time to maintain this project. It would be awesome if you could create pull request.

gi-ba commented 7 years ago

@mahmutpinarbasi Hi, Could you explain briefly to me why would we need to remove that part? I would really appreciate.

mahmutpinarbasi commented 7 years ago

Hi @giabao0212, sorry for the late response On line 87, destination viewcontroller's view is already added to container view by calling [containerView addSubview:toVC.view];. So checking/adding it to keyWindow again is not necessary.