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