views:

419

answers:

1

hi there,

i need to shrink the height of a UINavigationBar (attached to the UINavigationController)

i've done this via the UINavigationControllerDelegate's navigationController:didShowViewController method, and it's working fine.

the problem is the visible viewcontroller that's in the main view. it wasn't resizing itself to reflect the new navbar height. thus, the didShowViewController method also resizes the viewcontroller's view frame, which works fine.

however, when i go to push on a new ViewController, or pop, i always see the view shift down to the original position during the animated transition to the next view. then, due to the code i have in the didShowViewController in the NavControllerDelegate, it shifts it back up.

i'm curious as to the best way to ensure that the shift down never happens.

i tried placing the code that resizes the frame into the willShowViewController, but that doesn't do anything.

i've also made sure that the UIView's frame that is the view of the UIViewController that's being popped, is also of the proper/shifted dimensions. no go there.

it's like i need to intercept the drawing actions after the pushViewController is invoked, and before the UINavigationController's didShowViewController is called.

i've been staring at my code for hours & hours... not getting anywhere. hopefully this makes sense to someone out there.

thanks!!!

A: 

Another option I think would be to set the NavigationControllers navigationBarHidden equal to YES. This will hide the nav bar completely and then you can then draw whatever view you want in the place the bar would have resided. Just put controls on the view that wrap the navigation methods (push, pop, etc...). It might be a challenge to get it to have the same style as a nav bar though.

ordord00
interesting idea. so you think the problem with the view below the bar (i.e. a tableview) changing back to the original size would be solved by a custom nav bar? (that's my biggest problem, sorry if my original comment wasn't clear)
dan
ahh, i think you're onto something... this might be a shove in the right direction. will report back later.
dan
i've been able to go this route using this method -- defining my own navigation bar and hiding the 'factory provided'. it's more work, but to handle the customizations that i need i'll have to do it. thank you VERY much for your time. much appreciated.
dan