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 trial

iOS

How do you extend a navigation-bar vertically?

(Swift)

Hi, it seems as when comparing my navigation bar height to others i've seen mines not quite as high, so i was wondering how do I extend it vertically?

Some examples..:

http://prntscr.com/5u9usf

compared to mine:

http://prntscr.com/5u9uyl

2 Answers

Hi Matthew,

In order to get the navigation bar to extend to the top of your app you need to embed it within a navigation controller which you can do by selecting your view controller and then via the Editor menu in the menu bar navigate to Embed In and choose Navigation Controller.

Embed In Navigation Controller

Now you will have a nicer looking bar that extends from the status bar and is 66 pixels high.

Happy coding.

Thankyou!

You're welcome.

Hey Chris, I have another question, could you please help me with this? https://teamtreehouse.com/forum/what-would-i-use-to-navigate-between-different-single-views-through-using-a-page-control

Cheers

those are normally custom navBars. I usually use Visual Effect View with Blur and build my own nabber with custom segues.

I hope this leads you in the right direction

Thanks for the comment!~