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

View has been resized after transition #20

Open
picasso opened this issue Mar 23, 2014 · 2 comments
Open

View has been resized after transition #20

picasso opened this issue Mar 23, 2014 · 2 comments

Comments

@picasso
Copy link

picasso commented Mar 23, 2014

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!

@PatrickNLT
Copy link

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

@picasso
Copy link
Author

picasso commented Mar 24, 2014

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;
}

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