1

I have a Tabbar App with a Navigationcontroller on each Tab. The first tab shows a list of entries (RoomsViewController) which all navigate to a detail view (RoomDetailViewController). On that detail view there's a button which navigates to another ViewController (PhotoViewController). I have set everything up so that only that one last ViewController supports orientation changes, the rest doesn't. Everything works fine, but I have the problem when I'm in Landscape mode and then go back 1 ViewController (to RoomDetailViewController), it stays in Landscape mode and just looks ugly.

I would like to have it being in Portrait mode after tapping back.

On iOS 5 and below I just added this to RoomDetailViewController and it worked:

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];

Unfortunately this doesn't work on iOS 6.

Any solutions for that? Thanks in advance

4

1 回答 1

1
Implement this method in RoomDetailViewController,

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
于 2013-08-26T11:27:34.613 回答