UIPopoverController with embedded navigation controller doesn't respect preferredSize when popping taller UIViewController
| Originator: | vivemoa | ||
| Number: | rdar://16946356 | Date Originated: | 16-May-2014 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | iOS 7.1 (11D167) |
| Classification: | Reproducible: | always |
Summary:
If a popover's contentViewController is a UINavigationController, and a view controller is popped off of its stack, then the new current view controller's preferredContentSize height won't be applied to the popover if it's smaller than the one of the popped off view controller.
Steps to Reproduce:
1 - Display a popoverViewController containing a navigation controller with one tableViewController as rootViewController. (preferred content size for the rootViewController 300;100)
2 - Tap on a cell in the tableView from step 1 to display a new tableview with preferred content size 300;300.
3 - Tap the back button to pop the tableView from step 2 and return to the rootViewController.
Expected Results:
1 - popover content size is 300;100
2 - popover content size is updated to 300;300
3 - popover content size is updated back to 300;100
Actual Results:
1 - popover content size is 300;100
2 - popover content size is updated to 300;300
3 - popover content size is not updated and stays at 300;300
Version:
iOS 7.1/11D167
Notes:
I workaround it by implementing navigationController:didShowViewController:animated: this way on the UINavigationController
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
navigationController.preferredContentSize = viewController.preferredContentSize;
}
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!