Skip to content

Commit

Permalink
Add contentView inside container to contain controller view
Browse files Browse the repository at this point in the history
Do this so that controller's view sees the same frame values
as it does inside a UINavigationController
  • Loading branch information
mtrudel committed Apr 19, 2013
1 parent 84786a4 commit fc36e00
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/iOS/MTStackableNavigationController.m
Expand Up @@ -374,8 +374,11 @@ - (void)ensureContainerViewExistsForController:(UIViewController *)viewControlle
toolbar.items = viewController.toolbarItems;
[viewController.stackableNavigationItem.containerView addSubview:toolbar];
}
viewController.view.frame = contentFrame;
[viewController.stackableNavigationItem.containerView addSubview:viewController.view];
UIView *contentView = [[UIView alloc] initWithFrame:contentFrame];
contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
viewController.view.frame = contentView.bounds;
[contentView addSubview:viewController.view];
[viewController.stackableNavigationItem.containerView addSubview:contentView];
[viewController.stackableNavigationItem.containerView addSubview:navBar];
}
}
Expand Down

0 comments on commit fc36e00

Please sign in to comment.