views:

88

answers:

2

I've simple iphone application. it has 3 views. first view is portrait view that has 3 buttons. second view has a table view which is also a portrait. In first view, on click of a button second view is shown. on click of a cell in second view, thrid view is shown. but third view is a landscape. I'm using "pushViewController" to navigate from each view. When creating views in IB, first two views are portait and 3rd view is a landscape. In 3rd viewcontroller, i'm using following code as well:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft));

}

How can I show first two views in portrait and third view in landscape.

A: 

Try to put this in viewDidLoad

[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:YES];
Espuz
I did that as well.
Satyam svv
A: 

There is a collection of links to related issues in this thread. In particular, check out the answer of pix0r here.

user8472