views:

31

answers:

1

I'm trying to position the navigation bar below the top of the screen.

I've tried the following in viewWillAppear:

self.navigationController.view.frame = CGRectMake(0.0, 54.0, 320.0, 426.0); self.navigationController.navigationBar.frame = CGRectMake(0.0, 0.0, 320.0, 44.0);

The problem is it only seems to work the very first time the view is displayed. If you go to another tab, and back, the navigation bar is at the top of the screen. This also happens when the iPhone is rotated.

Should I be trying to adjust the navigation controller frame, or should I instead try to add the navigation controller to another view that is below the top of the screen?

A: 

I can change the frame by overriding the frame property in viewDidAppear of my custom navigation controller. I also add the navigation controller view to another view that is a subview of the window and make same clipping. Pay attention because in this way you're going to loose the standard calls to every view controllers that will be attached to the navigation controllers. I don't remember if I also used a custom view for my view controllers: maybe yes and with didMoveToSuperview or didMoveToWindow overrided just to emulate the default behaviour. Hope it helps and forgive my english.

marcio