I have to create application with two UIWindow
(please, don't ask why). First UIWindow
's rootViewController
supports all orientations. Second one - only portrait and upside down. So application delegate code looks like:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// part one
self.windowOne = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.windowOne.rootViewController = [[ViewControllerOne alloc] init]; // supports all orientations
self.windowOne.rootViewController.view = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image1.png"]] autorelease];
[self.windowOne makeKeyAndVisible];
//~part one
// part two
self.windowTwo = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.windowTwo.rootViewController = [[ViewControllerTwo alloc] init]; // supports only portrait and upside down
self.windowTwo.rootViewController.view = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image2.png"]] autorelease];
[self.windowTwo makeKeyAndVisible];
//~part two
return YES;
}
If only one of two parts is active (second one is commented) - everything is ok. But if windowOne has become key and visible before windowTwo
, windowTwo rotates as ViewControllerTwo
allows, but status bar behaves really weird: it rotates like windowOne
is key and visible.
Is there any option to make status bar rotating as ViewControllerTwo
says?