我已经开发了一个iOS应用,并在iOS6设备上进行了测试。在测试过程中,我意识到我的应用程序没有按预期响应方向变化。
这是我的代码:
// Autorotation (iOS >= 6.0)
- (BOOL) shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationMaskPortrait;
}
确切地说,我想知道在iOS中方向改变时调用了哪些方法。
shouldAutoRotate
方法是作为shouldAutorotateToInterfaceOrientation
的替代引入的。它可以在iOS5和iOS6中使用。 - Midhun MP