there is all this….
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortrait && interfaceOrientation != UIInterfaceOrientationLandscapeLeft && interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
and i want the accelerometer to work in landscape as if it was in portrait… I have all the accelerometer stuff such as:
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration*)acceleration {
accx = acceleration.x;
}
also i have tried looking at other questions but i can’t find the solution…?
Ok, if understood correctly, you are in portrait (in the X axis direction see the image), tilt right and tilt left then the image in your app should move right and left. Then you switch to landscape and your image should now move right and left but it doesn’t, the axis you should pay attention now is the Y axis.
There is no reason why you should not be seeing any change in the Y axis when you rotate to landscape, unless there is hardware damage and that the accelerometer had stopped working.
Now, what you ask for is a way to reset the accelerometer so that you can keep reading from the X even though the changes are happening in the Y axis? No, there is no way to do this, unless you write an extra method … something along the lines of: