ADTransitionController icon indicating copy to clipboard operation
ADTransitionController copied to clipboard

View has been resized after transition

Open picasso opened this issue 12 years ago • 2 comments

I have the following configuration - UIViewController placed in UINavigationController which is placed in UITabBarController.

My view is added as subview to the view of UIViewController and has constraints to fill the space between navigation bar and tab bar. Everything works if I do not use transitions (ADTransitionController does not work). When I activate ADTransitionController the animation itself works fine but when it's completed I find that my view has been resized - the new height is smaller by 49 points (the height of Tab bar).

It looks like ADTransitionController is responsible for the resizing of my view but I cannot understand the reason and find where it happens. Could you help me? Thanks in advance!

picasso avatar Mar 23 '14 19:03 picasso

Which API are you using? The new one with ADTransitioningViewController (iOS 7 only) or the other one?

PatrickNLT avatar Mar 23 '14 22:03 PatrickNLT

I'm using the last version of ADTransitionController, but I do not use ADTransitioningViewController. I setup ADTransitioningDelegate in UITabBarControllerDelegate protocol:

- (id<UIViewControllerAnimatedTransitioning>)tabBarController:(UITabBarController *)tabBarController
           animationControllerForTransitionFromViewController:(UIViewController *)fromVC
                                             toViewController:(UIViewController *)toVC
{
    if (_animationDelegate == nil) {

        ADTransition *transition = [[ADPushRotateTransition alloc] initWithDuration:0.4f
                                                                         orientation:ADTransitionRightToLeft
                                                                          sourceRect:tabBarController.view.frame];
        _animationDelegate =  [[ADTransitioningDelegate alloc] initWithTransition:transition];
    }

    NSUInteger fromVCIndex = [tabBarController.viewControllers indexOfObject:fromVC];
    NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC];

    ((ADTransitioningDelegate *)_animationDelegate).transition.type = (fromVCIndex < toVCIndex) ? ADTransitionTypePush : ADTransitionTypePop;

    return _animationDelegate;
}

picasso avatar Mar 24 '14 09:03 picasso