views:

87

answers:

2

Hello :)

Inside the titleView of a UINavigationBar, there is a button. Clicking it should slide in a view from the top of the screen.

Where do I have to place the view so it's displayed fullscreen and not only inside the current UIViewController's contentView?

Is there a function for adding fullscreen views?

A: 

It sounds like you want a modal view or you need to load an entirely new view all together.

If you add a view to another view as a subview it must be contained in the superviews bounds. There is no way to make a subview larger than its containing view.

A modal view can completely overlay any other views on the screen but it is not part of the view hierarchy. These are used for operations such as alerts or for sheets to fetch a specific piece of information related to view underneath.

If you need to completely obscure the original view, you need to load the other view and its view controller. Use a navigation controller to manage the views. By altering the transition, you can create the illusion that you are sliding sideways to another view, flipping to the back of the first view etc.

TechZen
Thank you for the fast answer! The problem is that a modalViewController is opaque. I need a textfield sliding in, ready to edit its text. The textfield should cover just the navigation bar. (the app has no status bar)
David
Okay, I solved it by hiding the navigation bar and showing my custom view.
David
A: 

Adding the view to the key window works.

[[[UIApplication sharedApplication] keyWindow] addSubview:(UIView *)subview];
David