Почему мое приложение для iPad не определяет изменение ориентации? - PullRequest
0 голосов
/ 25 января 2012

Использование следующего кода ничего не дает ... Мой взгляд вращается. Не могу этого понять ...

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    NSLog(@"I am starting to rotate");
}

Спасибо ...

Ответы [ 2 ]

0 голосов
/ 25 января 2012
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
    if(self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
       self.interfaceOrientation == UIInterfaceOrientationLandscapeRight){
           NSLog(@"I am starting to rotate in Landscape");

    } else {
           NSLog(@"I am starting to rotate in Portrait");

    }
}

и оставьте это так, как было

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}
0 голосов
/ 25 января 2012

Это может быть связано с тем, что ваш VC вложен в иерархию VC.

Этот пост SO должен помочь вам:

...