Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-24-2008, 11:34 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 72
Default Navigation Controller 20px short?

Have a nib that has a view and am loading a navigationController as a subview into that view. The issue is Im getting a extra 20 pixels of space above the navigation bar as shown here: http://www.eddit.com/misc/navigation_bug.jpg

In the nib file, for both the view and the navigationController object I have set the "Status Bar" option in the inspector to be "none", but I still get the space. Any ideas? More information needed?
eddit is offline   Reply With Quote
Old 09-24-2008, 11:38 AM   #2 (permalink)
1026 Development
 
Join Date: Jul 2008
Age: 23
Posts: 1,088
Send a message via AIM to Jeremy1026
Default

Try setting that view to start at x=0, y= -20
Jeremy1026 is offline   Reply With Quote
Old 09-24-2008, 02:09 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 72
Default

The view is filling up the whole space, as you can see the white above the navigation bar:http://www.eddit.com/misc/navigation_bug.jpg. That the view, so it does go to the top but the navigation controller is not.
eddit is offline   Reply With Quote
Old 09-27-2008, 12:43 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 72
Default

Found the answer:

CGRect frame = navigationController.view.frame;
frame.origin.y = 0.0;
navigationController.view.frame = frame;

Seems the default origin.y of a navigationController is 20.0;
eddit is offline   Reply With Quote
Old 09-27-2008, 01:16 PM   #5 (permalink)
New Member
 
Join Date: Jun 2008
Location: North Yorkshire, UK
Age: 27
Posts: 75
Default

Have you tried using bounds instead of frame?

I had a similar issue a while ago when switching to landscape orientation.
CaptainRedmuff is offline   Reply With Quote
Old 09-27-2008, 01:18 PM   #6 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 72
Default

No I havent, mostly because I am confused on the difference between a view's frame and its bounds. The reference literature makes them sounds the same. Is the frame the "frame" of the view and the bounds determines the position and size of the content within that frame?
eddit is offline   Reply With Quote
Old 09-27-2008, 06:22 PM   #7 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 361
Default

The issue is that you created the navigation in a subclass of something. Say you created the navigation controller and you added it to a view controller you have.

I previously contacted Apple via a bug report with this issue. They confirmed my mistake via Technical Support

Make sure you never add a navigation controller to a view controller. A navigation controller automatically rescales that top section for the status bar. What you see there is actually a hole at the top of your navbar left for the status bar to come through.

To avoid this, just never add the navigation controller to a view controller. Always do all working out with a navigation controller itself within the App delegate itself.
DevTeamOfOne is offline   Reply With Quote
Old 09-27-2008, 08:18 PM   #8 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 72
Default

Thats kinda rediculous isnt it? I mean how would we have navigation controllers nested inside our apps? For instance the mail app that loads a navigation controller modally?

I guess, in my situation, a navigation controller modally...you would not load a view modally that loaded a navigation controller...you would just load the navigation controller modally.

Oh me oh my....it so confusing sometimes.....

I do appreciate everyones help though.

Last edited by eddit; 09-27-2008 at 09:00 PM.
eddit is offline   Reply With Quote
Old 09-28-2008, 02:05 PM   #9 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 361
Default

Just create your modal view controller with a navigation controller around it in the app delegate. Add the app delegate's modal navigation controller property as a modal view controller. There. Simple.
DevTeamOfOne is offline   Reply With Quote
Old 12-05-2008, 08:08 PM   #10 (permalink)
Registered Member
 
Join Date: Sep 2008
Posts: 47
Default

hi all

ok, I'm completely perplexed by this. I've used IB (exclusively) to create a UINavigationController inside a UITabBarController. things are pretty much working as I'd like - I can navigate from the main controller to any of the tabs, or use the table to navigate to a new controller and back. no problemo. in fact, the app is almost done... except I really want one of the views to be full screen (dynamically hiding the navbar after a fade).

as it stands now, when I navigate to the new (non-tab) controller I can't get the controller to use the whole screen - hiding the status bar or the navbar just leaves empty space up top.

it seems like everyone is struggling with the same issue, and i've tried all kinds of bound and frame adjustments, but to no avail. I've also been following this forum for a while now, and I know DevTeamOfOne knows what he's talking about (and that he doesn't really use IB . but I'm completely lost by the answer here. in truth, I can't even really parse it.

I have a feeling I need to start the underlying app framework from scratch without IB, but I could really use some direction on getting all three things working well together: navcontroller to a full-screen view (within a tabbar).

TIA
stopwatch is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 427
13 members and 414 guests
bev6a8hl, beyondstop, Edsilmars, HowEver, Hyde, john234ny, linkmx, MozyMac, phillipie99, pill5b3rry, pochuang, pufftissue, Rudy
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 157,847
Threads: 88,913
Posts: 379,291
Top Poster: BrianSlick (7,072)
Welcome to our newest member, bev6a8hl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:50 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0