0

ユニバーサル アプリケーションを実装しています。私のアプリケーションでは、iPhone ではなく iPad の画面を自動回転する必要があります。どうやってやるの?次のコードで試しましたが、うまくいきません。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return NO;
}
4

2 に答える 2

0

shouldAutorotateUIViewControllerとメソッドで設定するのに苦労した後 supportedInterfaceOrientation、iOS6 で成功しなかったため、最も効果的なのはアプリ デリゲートで設定することであることがわかりました。

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskPortrait;
}

ただし、戻るUIInterfaceOrientationMaskPortraitUpsideDownとアプリがクラッシュしていました。何を間違えたのかわからない!

于 2013-03-18T10:16:48.913 に答える
0

最後に、plist ファイルのプロパティを変更して作成しました。

于 2012-11-28T05:14:06.523 に答える