1

と を使用iOS 5してXCode 4.2います。コーディング後、横向きと縦向きをサポートしました。正常に動作しています。しかし、 でコードを使用した場合、向きはサポートされていませんXCode 4.5 iOS 6

誰も理由を知っていますか?

4

2 に答える 2

2

プロジェクトの設定を確認してください (概要)

許可された向きのサポートされているインターフェイスの向きの設定

ここに画像の説明を入力

また

次のコードを使用して向きをロックしてみてください。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown );
}
于 2013-09-11T05:17:32.280 に答える
0

それが正しいかどうかはわかりません。しかし、一時的に私はこの方法を使用しました。便利な場合は、あなたも使用できます。

このメソッドは、Appdelegate.

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
 [navigationController.topViewController shouldAutorotate];
 return UIInterfaceOrientationMaskAll;
}

- (BOOL)shouldAutorotateにメソッドを記述できますviewController

于 2013-09-11T06:22:02.733 に答える