ios 7 UINavigationBar is above content when using Auto Layout - ios

I am using Auto Layout in a storyboard to position a UICollectionView. I have created a vertical spacing between Top Layout Guide and the CollectionView. But the collection view still starts underneath the navigation bar. Even the prototype cell also has extra padding. Please see images below.
Interface Builder:
Simulator View:
The content should start below the navigation bar but as the user scrolls the content should go under the navigation bar. How do I accomplish this?

In your storyboard go to View Controller properties, and make sure that Under Top Bars option is unchecked.
Also in most cases you want to have opaque navigation bar.

Related

Adjust Navigation Bar width inside NavigationController

I am trying to implement a horizontal scrolling table view. I was able to accomplish this with the following layout. I have a ScrollView which contains a Container View which points to my NavigationController. Since I made the Container View wider than the ScrollView, the table is able to scroll left to right as expected.
The problem I am having is resizing the Navigation Bar's width as I do not want to have to scroll to view the Navigation Bar's title. I tried explicitly setting the width property of the Navigation Bar in ViewDidAppear however it keeps getting resized to the actual width of the table view. Is there any way I can do this without having to create my own custom view that mimics that Navigation Bar?
I ended up creating my own navigation bar that is placed on top of the actual integrated table view navigation bar.

UIView inside UIScrollerView displays with -64 offset

I'm trying to create a form that will be larger than the screen size and I've decided to use a view inside a scrollerview, then I'm adding the rest of the UI widgets (textfields, buttons, etc.) inside the view.
The view displays and scrolls, but no matter what I try, it displays with a vertical offset of -64 below the navigation controller bar. Once there the view will happily scroll up down.
I want the view to anchored at the top, just below the navigation bar, and then scroll down.
I am using IB.
Lots of time researching and not many answers that have worked for me. UIScrollView seems to be like one of those dirty secrets the whole iOS world seems to avoid....
Thank you for your help.
You can fix this in the storyboard
1- Select the view Controller
2- GO to attributes inspector
3- Uncheck adjust scroll View insets
For your view controller, in the storyboard uncheck the option to extend edges under top bar.

Top Layout Guide won't start at top of screen in Xcode 6 storyboard

I have 2 view controllers setup identically in a Storyboard. On one, the top layout guide goes all the way to the top (under the status bar), on the other the top layout guide starts just below the status bar.
On both view controllers, I have Extend Edges Under Top Bars (checked) and Adjust Scroll View Insets ->unchecked (not that I'm using a scroll view here).
I can't figure out why these are different in the storyboard, and thus at run time one view controller looks like the way it was designed, the other does not because items with constraints to that top layout guide will be 20px wrong.
Help.

UITableViewController Inside UINavigationController and UITabBarController Bottom Inset Off

I have a UITableView inside a UINavigationController that's inside a UITabBarController. There is a view on the bottom (I'll call it bottomView) between the table view and the tab bar that needs to stay at the bottom as the table view scrolls, so I can't put it as a footer in the table view.
The issue is that when i scroll to the bottom of the table view, there is an empty space the same height as the tab bar between the lowest content (and the scroll bar) and the top of bottomView.
I think this is because the table view is trying to automatically compensate for the tab view at the bottom, but I can't position it all the way at the bottom because of bottomView.
here's my IB layout:
and the display (last tableViewCell highlighted):
If I understand your question correct you need to set a contentInset to your tableView like this:
[self.tableView setContentInset:UIEdgeInsetsMake(0,0,44,0)];
Edit:
Ok I think I got it. Set:
self.automaticallyAdjustsScrollViewInsets=NO;
I've seen this same nav controller->tab bar->tableview situation frustratingly cause the tableview to partially overlap with the navigation bar, instead of not reaching the tab bar. To anyone having this issue when using a UITableView: ensure your navigation bar is not translucent. If you want to use this setup with a translucent navigation bar, select the UITabBarController in the Interface Builder and uncheck the "extend edges under top bars" option in the attributes inspector.

In Xcode 5 in a GLKViewController in IB what are the Top/Bottom Layout guides for?

In Xcode 5 in a GLKViewController in IB what are the Top/Bottom Layout guides for? I've been reading through docs and can't seem to find it anywhere.
These are not specific to GLKViewController -- you'll see them in any view controller.
In iOS 7, views extend underneath the transparent status, navigation, and tab bars (if present) by default. Because you probably don't want your subviews ending up underneath these bars, the layout guides provide an easy way to set up layout constraints relative to wherever those bars end up.
For example, say you want a button to appear 20pt below the navigation bar. Where before you'd make a constraint between the button and the top of the view, you can now make a constraint between the button and the top layout guide. That view in the nib isn't responsible for setting whether the navigation bar is shown or how tall it is -- those things are controlled by the view controller that presents the view at run time -- so constraining to the top layout guide makes sure your button is in the right place regardless of how the view is presented.

Resources