 |
 |
|
 |
09-24-2008, 11:34 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 72
|
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?
|
|
|
09-24-2008, 11:38 AM
|
#2 (permalink)
|
|
1026 Development
Join Date: Jul 2008
Age: 21
Posts: 783
|
Try setting that view to start at x=0, y= -20
|
|
|
09-24-2008, 02:09 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 72
|
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.
|
|
|
09-27-2008, 12:43 PM
|
#4 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 72
|
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;
|
|
|
09-27-2008, 01:16 PM
|
#5 (permalink)
|
|
New Member
Join Date: Jun 2008
Location: North Yorkshire, UK
Age: 25
Posts: 75
|
Have you tried using bounds instead of frame?
I had a similar issue a while ago when switching to landscape orientation.
|
|
|
09-27-2008, 01:18 PM
|
#6 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 72
|
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?
|
|
|
09-27-2008, 06:22 PM
|
#7 (permalink)
|
|
New Member
Join Date: Aug 2008
Posts: 361
|
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.
|
|
|
09-27-2008, 08:18 PM
|
#8 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 72
|
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.
|
|
|
09-28-2008, 02:05 PM
|
#9 (permalink)
|
|
New Member
Join Date: Aug 2008
Posts: 361
|
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.
|
|
|
12-05-2008, 08:08 PM
|
#10 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Posts: 45
|
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
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 459 |
| 50 members and 409 guests |
| !_UK@$, acerola, aryaxt, bbc z, BrianSlick, Chris Stewart, CoxTral, cphilc, CunningCat, dany88, darage, dcinqc, DenVog, endy13, falcon76, ggalante, Gudus, iPhoneDevelopment, JHawk1, jingledale, joelm, josep@sixtemia.com, Kroupy, Kryckter, kyeck, lanej, lukeca, LunarMoon, mlfarrell, mlo, nDev1, NicolasD, nobre84, NSeven, P2k, PeddlePower, pereorra, ryguy2503, scribouillard, sennah, shay_somech, sjurmr, smasher, StevenD, TapTouchClick, thewitt, treazer, VanCrey, ZunePod |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,500
Threads: 35,780
Posts: 156,758
Top Poster: smasher (2,449)
|
| Welcome to our newest member, VanCrey |
|