Created
January 20, 2016 20:27
-
-
Save thornpig/dca4383c8494bae3a5ee to your computer and use it in GitHub Desktop.
Work around for the problem: Frame of container view is not right when its frame is setup via autolayout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)viewDidLayoutSubviews | |
{ | |
self.containerView.frame = self.view.bounds; | |
self.currentVC.view.frame = self.containerView.bounds; | |
} | |
-(void)showChildViewController:(UIViewController *)childVC | |
{ | |
[self addChildViewController:childVC]; | |
self.containerView.frame = self.view.bounds; | |
self.currentVC.view.frame = self.containerView.bounds; | |
[self.containerView addSubview:childVC.view]; | |
[childVC didMoveToParentViewController:self]; | |
self.currentVC = childVC; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment