私が欲しいのは、iPhoneの縦向きとiPadアプリの横向きです。私のアプリは> ios5 を対象とし
ていますこれについてWebで検索しましたが、正確な回答ではなく、異なる回答が得られました。
2 に答える
0
だからここに私がしたことがあります
iPhoneの場合
そしてiPad用
また、コードの下に追加した iPad コントローラーの場合、これはios6アプリケーションには必要ありません。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
于 2013-07-13T09:07:36.553 に答える
0
このコードをアプリのデリゲートに追加するだけで、これを実行できるはずです。
スウィフトコード:
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int {
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
return Int(UIInterfaceOrientationMask.Portrait.rawValue)
} else {
return Int(UIInterfaceOrientationMask.LandscapeLeft.rawValue | UIInterfaceOrientationMask.LandscapeRight.rawValue)
}
}
于 2015-03-02T21:46:25.777 に答える