Objective c 无法将iPhone旋转到正确的方向
我的iPhone设备有这种奇怪的行为。 Hi构建了一个视图控制器,可以在横向模式下从左向右旋转。在模拟器中一切都很顺利,但当我在iPhone上构建项目时,它总是向左旋转 这里有两种处理方向的方法Objective c 无法将iPhone旋转到正确的方向,objective-c,iphone,ios7,rotation,xcode5,Objective C,Iphone,Ios7,Rotation,Xcode5,我的iPhone设备有这种奇怪的行为。 Hi构建了一个视图控制器,可以在横向模式下从左向右旋转。在模拟器中一切都很顺利,但当我在iPhone上构建项目时,它总是向左旋转 这里有两种处理方向的方法 - (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIDeviceOrientationLandscapeRight | UIInterfaceOr
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIDeviceOrientationLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
这是某种加速度计问题吗
谢谢而不是
- (NSUInteger)supportedInterfaceOrientations {
return UIDeviceOrientationLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
用这个
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
也许你已经锁定了iPhone上的旋转?将你的
UIDeviceOrientation和scapeRight
替换为UIInterfaceOrientationMask和scapeRight
谢谢@spassas!下次我会把我写的读得更好。