Start a new topic

AR View rotated by 90 degrees

AR View rotated by 90 degrees


Hi,

 

since upgrading to iOS 6 (and the latest version of XCode) I face the following problem: the AR view is always rotated 90 degrees clockwise. I implemented the shouldAutorotateToInterfaceOrientation() method like this:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    BOOL shouldAutorotateToInterfaceOrientation = NO;
    
    if ( == UIUserInterfaceIdiomPhone) {
        shouldAutorotateToInterfaceOrientation = (interfaceOrientation != UIInterfaceOrientationLandscapeRight);
    } else {
        shouldAutorotateToInterfaceOrientation = YES;
    }
    
    if (shouldAutorotateToInterfaceOrientation) {
        NSLog(@"shouldautorotate = YES");
    } else {
        NSLog(@"shouldautorotate = NO");
    }
    if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        NSLog(@"UIInterfaceOrientationLandscapeRight");
    }
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
        NSLog(@"UIInterfaceOrientationLandscapeLeft");
    }
    if (interfaceOrientation == UIInterfaceOrientationMaskPortraitUpsideDown) {
        NSLog(@"UIInterfaceOrientationMaskPortraitUpsideDown");
    }
    if (interfaceOrientation == UIInterfaceOrientationPortrait) {
        NSLog(@"UIInterfaceOrientationPortrait");
    }
    
    /* To support autorotation within the architect view, simply tell the architect
     view if it should rotate into the new interface orientation */
    if (_architectView) {
        ;
    }
    return shouldAutorotateToInterfaceOrientation;
}

I also tried different versions of this method like:

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

however, this also doesn't work. I'm urgently looking for any hints/tips on that...

Thanks

      Christian

Hi Christian,

iOS 6 changed the way interface orientation are handled. 

To get your WTArchitectView rotating again, you need to override:

 

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

{

    /* To support autorotation within the architect view, simply tell the architect view in which interface orientation the device is going to change */

    if (self.architectView) {

        ;

    }

 

}

of your View Controller.

This sollution will work on iOS 5 and iOS 6.

If your Application is not rotating as expected, please make sure that you have selected all your supported orientations in your targets summary section in Xcode (more details).

Best regards

Andreas

Thanks a lot! Works like a charm...

Bye, Christian
Login or Signup to post a comment