The minimal illustrative Xcode project for this is available on github .
In my UIWindow, when I add the second (and subsequent) UITableView as subzones, they do not rotate properly and thus appear on the side. This is only checked in the simulator. Here is a small code:
- (void)applicationDidFinishLaunching:(UIApplication *)application { ShellTVC* viewA = [[ShellTVC alloc] initWithTitle:@"View A"]; ShellTVC* viewB = [[ShellTVC alloc] initWithTitle:@"View B"]; // The first subview added will rotate to landscape correctly. // Any subsequent subview added will not. // You may try this by various commentings and rearranging of these two statements. [window addSubview:[viewA tableView]]; [window addSubview:[viewB tableView]]; [window makeKeyAndVisible]; }
viewB appears on the side. Comment on addSubview for viewB and viewA will appear correctly. Do this only for viewA, and viewB will appear correctly.
I do not create these UITableViewControllers via NIB, although UIWindow.
If you're interested, ShellTVC is a UITableViewController and implements this method:
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); }
In addition, I set UIInterfaceOrientation in the plist file to UIInterfaceOrientationLandscapeLeft.
Perhaps related and unanswered - SO questions here and here .
iphone landscape
Clay Bridges Oct 27 '09 at 16:38 2009-10-27 16:38
source share