Unable to rotate iPhone to the right direction
-
21-12-2019 - |
Question
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
La solution
Instead of
- (NSUInteger)supportedInterfaceOrientations {
return UIDeviceOrientationLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
Use this
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow