0

私が欲しいのは、iPhoneの縦向きとiPadアプリの横向きです。 を対象とし
ていますこれについてWebで検索しましたが、正確な回答ではなく、異なる回答が得られました。

4

2 に答える 2

0

だからここに私がしたことがあります

iPhoneの場合 ここに画像の説明を入力

そしてiPad用 ここに画像の説明を入力

また、コードの下に追加した iPad コントローラーの場合、これはアプリケーションには必要ありません。

- (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 に答える