views:

421

answers:

1

I have a "navigation based application" which also needs to have a view always displayed at the bottom of the screen at all times. I added this new view to a UIWindow after adding the UINavigationController's view:

// In my delegate's applicationDidFinishLaunching method
[window addSubview:navigationController.view];
[window insertSubview:disclaimerController.view aboveSubview:navigationController.view];
[window makeKeyAndVisible];

This works fine except for rotation. The second view I added doesn't rotate correctly. It doesn't change position and it's view controller's rotate methods don't get called.

Obviously, I'm going about this the wrong way. My question is, how can I have a second view on screen that's not part of navigation controller's view? Thanks.

A: 

If you are adding a view ontop of another by adding as subview rotation will not work (view won't be notified of rotation). What u can do is register the view with the device to be notified of rotation events, then u can programatically handle rotation (it will not do it for u)

Daniel
I'm not sure I explained the issue correctly. This was specific to the UIWindow where the first view added to the UIWindow would rotate correctly and any subsequent views would not rotate or resize at all, but stay in a fixed position. My solution has been to only add the NavigationController's view to the window and add any subsequent views to the NavigationController's view.
codecaffeine
O you added two views to the window?
Daniel
Yeah, I thought it might be a solution since I wanted something separate from the Navigation Controller's view.
codecaffeine