4

我已经SplitView在我的应用程序中实现了。

我的应用程序适用于 ios 5 和 ios 6。

在 ios 5 中使用方法

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

旋转工作正常。

但在 ios 6 中,roataion 方法不调用。我已经为 ios 6 尝试了以下方法;

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

我还搜索并尝试了 ios 6 的其他轮换方法,但它们没有用。

我想同时支持 ios 5 和 ios 6 的旋转。

我怎样才能做到这一点?

谢谢。

4

1 回答 1

0

请在 AppDelegate 中重写此方法:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{

    return UIInterfaceOrientationMaskAll;//或要求
}
于 2013-05-21T10:29:08.010 回答