Rotating iPhone/iPad
I found out that rotation makes my app crash.
When you hold the device in your hand, you move it a bit and app registers all of those tiny movements, changing orientation accordingly, and it looks as app's busy. Everything slows down.
Also, when I scroll something and simultaneously change orientation, scrolling stops.
How can this things be managed?
EDIT:
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOr开发者_运维知识库ientation toInterfaceOrientation) {
if (UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.FaceUp ||
UIDevice.CurrentDevice.Orientation == UIDeviceOrientation.FaceDown)
{
return false;
} else {
return true;
}
}
That bit of code is not causing your crash, it looks fine. You need to run with the debugger and find out where the exception is and then figure out why it gets an exception. Otherwise we are just guessing in the dark.
精彩评论