Q:

Can't change the size of a UIWindow

I'm trying to add a new window on top of my current one, on an iPad application, but I can't figure out why it always presents itself as fullscreen.
I'm using this code:
UIWindow *window = [[UIWindow alloc]initWithFrame:CGRectMake(0, 0, 20, 20)];

[window setFrame:CGRectMake(0, 0, 20, 20)];
ArrowController *controller = [[ArrowController alloc]initWithNibName:@"ArrowController" bundle:nil];   

[window setRootViewController:controller];    
[window setHidden:NO];

[controller release];

No matter what size I set on its frame I always get presented with a full screen sized window.
Please advise, thank you.

A:

To change the frame of another UIWindow you add, you have to init your window with the frame you want:
self.myNewWindow = [[UIWindow alloc] initWithFrame:CGRectMake(10, 10+20, 300, 440)];

Set its property clips to bounds to active:
[self.myNewWindow setClipsToBounds:YES];

And then after setting your rootViewController to the new window, set its frame too:
self.myNewWindow.rootViewController = self.fooViewController;
[self.myNewWindow makeKeyAndVisible];

self.fooViewController.view.frame = CGRectMake(0, 0, 300, 440);

This is working on iPhone and iPad.

A:

iOS apps are only supposed to have one UIWindow object. 
you should probably be setting the frame on the UIView of the viewController, and adding it as a subview.

