Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The difference between a UIWindow and a UIView

After creating a blank xib file, it seems that we can either drag a UIWindow or UIView to cover the entire screen. My question is what are the practical differences between the two and in what circumstances that we should use one over the other?

like image 881
Stanley Avatar asked Nov 22 '11 21:11

Stanley


People also ask

What is the purpose of UIWindow object?

You also use UIWindow objects for a handful of other tasks: Setting the z-axis level of your window, which affects the visibility of the window relative to other windows. Showing windows and making them the target of keyboard events. Converting coordinate values to and from the window's coordinate system.

Can we have multiple UIWindow IOS?

UIWindows are the special UIViews, for which their display order is controlled by . windowLevel property. You don't need to add a new UIWindow as a subview of any of view. You can simply create a new UIWindow and call either window setHidden:NO or window makeKeyAndVisible depend on the level, you have given to it.

How do I add a view in UIWindow?

window; UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; aView.

What is window in IOS?

A window handles the overall presentation of your app's user interface. Windows work with views (and their owning view controllers) to manage interactions with—and changes to—the visible view hierarchy.


1 Answers

Windows do not have any visible content themselves but provide a basic container for your application’s views. Views define a portion of a window that you want to fill with some content. Typically, there is only one window in an iOS application.

About Windows and Views

like image 147
beryllium Avatar answered Oct 04 '22 12:10

beryllium