문제

i've got this strange behavior from my iPhone device. Hi built a view controller that can rotate from Left to Right landscape mode. Everything goes well in the simulator but when i build the project to the iPhone it always rotate to Left Landscape.

Here the two methods for the handling of the orientation

- (BOOL)shouldAutorotate {
    return NO;
}

- (NSUInteger)supportedInterfaceOrientations {
    return UIDeviceOrientationLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}

Is this some kind of accelerometer issue??

Thanks

도움이 되었습니까?

해결책

Instead of

- (NSUInteger)supportedInterfaceOrientations {
    return UIDeviceOrientationLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}

Use this

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