Rotation behaving differently on iOS6

后端 未结 12 2199
野的像风
野的像风 2020-11-30 06:00

I did an App which is tab-based. Nothing needs to be on landscape mode but a couple of views. It worked OK on iOS5 and I was pretty happy with the result. However with iOS6

12条回答
  •  一生所求
    2020-11-30 06:43

    This code common for ios5 and ios6

    -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
        if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
            [self performSelector:@selector(setframeLandscap) withObject:nil afterDelay:0.2];
        }
        else {
            [self performSelector:@selector(setframePortrait) withObject:nil afterDelay:0.2];
        }
    }
    
    -(BOOL)shouldAutorotate {    
        return YES;
    }
    

提交回复
热议问题