Domanda

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

È stato utile?

Soluzione

Instead of

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

Use this

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top