ストーリーボードに5つのビューがあります。たとえば、あるビューがUIInterfaceOrientationLandscapeRight別のビューになるUIInterfaceOrientationLandscapeLeftか、UIInterfaceOrientationPortraitまたはになるように、各ビューの向きが異なるようにしUIInterfaceOrientationPortraitUpsideDownます。では、このビューの向きをどのように設定するのですか。
使用
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
しましたが、「UIDevice が setOrientation に応答しない可能性があります」という警告が表示されます。私が使用している多くのstackoverflowライターによると
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
//return UIInterfaceOrientationLandscapeLeft;
return (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
これは上記のコードですが、私のプロジェクトでは機能していません。では、画面の向きの適切な手順は何ですか。前もって感謝します。