Autorotate UINavigationController based Application in IPhoneOS 3.0

Posted by Shoaibi on Stack Overflow See other posts from Stack Overflow or by Shoaibi
Published on 2010-04-18T14:24:55Z Indexed on 2010/04/18 14:33 UTC
Read the original article Hit count: 879

I have an application which have code like:

window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // UIWindow *window;
viewController = [TopicsViewController new]; //TopicsViewController *viewController; //This is a UITableViewController
navigationController = [UINavigationController new]; // UINavigationController *navigationController;
UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]];
[self.navigationController.view addSubview:background];
[self.navigationController.view sendSubviewToBack:background];
[navigationController pushViewController:viewController animated:YES];
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];

Basically i am using UINavigationController and then push UITableViewController or sometime a UIViewController. UIViewController contain elements such as UITextView, UIImage, UIScrollView. Problem is i have been trying to make this application respond to iphone rotation e.g. when held in landscape, application should switch to landscape and vice versa, but nothing works so far.

© Stack Overflow or respective owner

Related posts about iphone-sdk-3.0

Related posts about autorotate