と を使用iOS 5
してXCode 4.2
います。コーディング後、横向きと縦向きをサポートしました。正常に動作しています。しかし、 でコードを使用した場合、向きはサポートされていませんXCode 4.5
iOS 6
。
誰も理由を知っていますか?
と を使用iOS 5
してXCode 4.2
います。コーディング後、横向きと縦向きをサポートしました。正常に動作しています。しかし、 でコードを使用した場合、向きはサポートされていませんXCode 4.5
iOS 6
。
誰も理由を知っていますか?
プロジェクトの設定を確認してください (概要)
許可された向きのサポートされているインターフェイスの向きの設定
また
次のコードを使用して向きをロックしてみてください。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown );
}
それが正しいかどうかはわかりません。しかし、一時的に私はこの方法を使用しました。便利な場合は、あなたも使用できます。
このメソッドは、Appdelegate
.
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
[navigationController.topViewController shouldAutorotate];
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotate
にメソッドを記述できますviewController
。