Have you guys stumbled up on this issue ?
Basically in iOS 7 Navigation Controller is rendered over the sub-view I navigated to.
In iOS 6 view I navigate to is enclosed between navigation bar and footer. In iOS 7 it looks like sub-view is rendered full-screen, under navigation bar and footer. As result user don't see it.
Here is how I navigate to subview
BRSMyListSubViewController *tagsInfoVC = [[BRSMyListSubViewController alloc] initWithCheckinsList:self.checkinsList
selectedTag:[self tagByIndexPath:indexPath]];
[self.navigationController pushViewController:tagsInfoVC animated:YES];
Here is how I initialize it in viewDidLoad
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStyleBordered target:self action:@selector(settings:)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStyleBordered target:self action:@selector(logout:)];
For what it's worth I should also mention that sub-view is defined in XIB using Autolayout. Here is source of my XIB: http://pastebin.com/6RR0zYu4
And finally here is how it looks in iOS 6
And in iOS 7
Any thoughts ?
Introduction to Navigation Controllers. A UINavigationController is a view controller subclass that makes navigation between multiple view controllers easier. In addition to easier navigation, a navigation controller also has a lot of built-in functionality that we'll explore in this section.
Step 1: Embed root view controller inside a navigation controller. In your storyboard, select the initial view controller in your hierarchy. With this view controller selected, choose the menu item Editor -> Embed In -> Navigation Controller .
The navigation controller manages the navigation bar at the top of the interface and an optional toolbar at the bottom of the interface. The navigation bar is always present and is managed by the navigation controller itself, which updates the navigation bar using the content provided by its child view controllers.
Well, I figured it out.
In your sub-view (BRSMyListSubViewController
in my case), in viewDidLoad
, you need to set one of these two
self.edgesForExtendedLayout = UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;
OR
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = YES;
Interestingly enough in root view controller these value are set to default UIRectEdgeAll
, NO
and YES
respectively but its tableView
is NOT under navbar and footer.
I don't know why it's so illogical.
It's also strange that edgesForExtendedLayout
has to be mixed with one of two other properties even though it's clearly responsible for the behavior.
PS. For those who wants to run it on iOS 6. Surruound the code with if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With