Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialVincent K
3,356 PointsNavigation bar is blocking my Username text field
It seems like I can't access the first item in my log in and sign up scenes - there is no longer a username text field either visible in my storyboard scene, or in the outline view. It seems the navigation bar is covering or replaced the username text field.
Can anyone help me rectify this? I've played with auto layout but nothing has worked so far.
6 Answers
busterlabs
9,276 PointsHey ok I got it now. Played around with the attributes inspector and found the Extend Edges in the View Controller under the attributes inspector. Deselected the "Under Top Bars" box and it worked.
Thanks for pointing me in the right direction!
Vincent K
3,356 PointsBrilliant, just tried that in Xcode. thanks for coming back with that solution.
Vincent K
3,356 PointsJoey, incidentally, had you any trouble getting the title onto the navigation bar for the login and signup screens? I haven't been able to manage it. I've been trying to work out a way to do it in interface builder and it doesn't work like it did with the Xcode version the tutor has (theirs is Xcode 4 I think, mine's Xcode 6).
I can't click into my navigation bar to add a title- It worked fine for the tableview controller which I embedded in the navigation controller. The segues are there, etc. Did yours work?
Marlon Henry
6,885 PointsWhen using the auto layout are you manually setting the constraints yourself or are you letting Xcode figure it out itself? Also in the regular view controller in Storyboard is it placed under the navbar or on top of it? Love to see screen shots to better help.
Vincent K
3,356 PointsI didn't make any adjustments to it with auto layout. I just placed the username text field at the top of the scene, as was done in the video, and I presumed that if a navigation bar was added that any elements potentially in the way of it would be dropped underneath. It's good to know that isn't the case - you have to leave space for the bar I think.
Marlon Henry
6,885 PointsYes I usually place my view a little bit smaller then the battery icon in the simulator so I don't have any design element issues.
busterlabs
9,276 PointsOk so I'm having the same issue, but couldn't figure out how you guys fixed the issue. A little help please? Thanks
Vincent K
3,356 PointsIf your username text field is not visible to you, you can make it visible by clicking on the space where it is and by selecting/deselecting the 'hidden' checkbox in attributes inspector. Then you can drag it down under where the bar should be and reposition it underneath nav bar.
Then if like for me the navigation bar is not clickable, even though you've embedded your table view in the navigation controller, and made the correct segues, then you can actually manually add a navigation bar using the navigation bar object from object library, as you would another UI element.
I had the extra problem that the navigation bar would not sit in my view, even though I was zoomed in, but I closed Xcode, restarted, and it worked after that.
That fixes it, but I still don't know why the navigation bar did not carry across to the log in and sign up views just like it did in the older Xcode version that the tutor in the video uses.
busterlabs
9,276 PointsHi Vincent. I tried selecting and deselecting the hidden button in the attributes inspector but still couldn't show the Username text field.
Would you have any other suggestions?
Vincent K
3,356 Pointsdid you have the view selected before you went into attribute inspector yeh?
busterlabs
9,276 PointsOk I can see it now. But how do I move it down? I can't select it because it's behind the Ribbit Navigation Bar
Vincent K
3,356 Pointsif you can see it now you should be able to drag it down underneath the space where nav bar should be. select the nav bar instead and try checking and unchecking the hidden settings there to bring the username forward so that you can drag it then.
Vincent K
3,356 Pointsthe other thing you could do if you keep having trouble is to select usename field from document outline - if you can find it there- and delete it from there and make a new one.
Erion Vlada
13,496 PointsErion Vlada
13,496 PointsQuick tip I learned after a lot of annoyance. Find what is being hidden in your Document Outline (the tab on the left of the storyboard) and simply drag and drop the textfield(s) from there back onto your view controller on your storyboard.
Here is a visual example, the way I learn
Locate what is not being shown
Drag it back into the view controller where you want it