문제

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

도움이 되었습니까?

해결책

Implement this method in RoomDetailViewController,

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top