Search code examples
iphoneioscocoa-touchuiwindow

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.


Solution

  • 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.