네비게이션 컨트롤러의 루트보기 컨트롤러는 세로 방향 만 지원하고 다른 컨트롤러는 모든 방향을 지원합니다. 이제 루트보기 컨트롤러에 있고 장치는 가로 방향으로 모든 방향을 지원하므로 가로로 열어야하는 세로로 열리는 다음보기 컨트롤러를 밀어 넣으면됩니다.하나의보기 컨트롤러에서 힘의 세로가 처음에는 세로로 표시됩니다.
도와주세요. 이의 ViewController을로드 할 때 처음 장치 oriantation을 확인
-(void)viewWillAppear:(BOOL)animated
{
[self willRotateToOrientation:[[UIDevice currentDevice] orientation]];
[super viewWillAppear:YES];
}
- (void)willRotateToOrientation:(UIInterfaceOrientation)newOrientation {
if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
{
if (newOrientation == UIInterfaceOrientationLandscapeLeft || newOrientation == UIInterfaceOrientationLandscapeRight) {
//set your landscap View Frame
[self supportedInterfaceOrientations];
}
}
else if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation))
{
if(newOrientation == UIInterfaceOrientationPortrait || newOrientation == UIInterfaceOrientationPortraitUpsideDown){
//set your Potrait View Frame
[self supportedInterfaceOrientations];
}
}
// Handle rotation
}
SOR과 - 아이폰 4S iOS6.1.3
당신이 울부 짖는 코드를 사용하여의 ViewController 로그인 후 첫 화면에서 장치의 방향을 확인할 수 있습니다
기기 회전을 계속하면 회전하나요? 또는 그것은 초상화에 남아 있습니까? – jcesarmobile
@ jcesar : 기기를 회전하면 회전합니다. – Nilesh