开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜