LoginSignup
1
2

More than 5 years have passed since last update.

iPadでDevice OrientationをPortraitのみにする方法

Last updated at Posted at 2018-08-29

iPadでは全てのOrientationに対応する必要があるようなのですが、Portraitのみにする方法があったので紹介します。

動作環境

Deployment Target: 11.0

対応方法

Requires full screen

Requires full screen` にチェックを入れます。

`スクリーンショット 2018-08-29 16.56.52.png

この設定を行うとマルチタスキング機能が使えなくなるため、御理解の上で設定下さい。

ちなみに、スクリーンショットで Portrait にのみチェックが入っていますが、この設定でもiPadでは Portrait 以外にもなります。

supportedInterfaceOrientations

対応が必要なViewControllerで以下の実装を行います

    override var shouldAutorotate: Bool { return true }
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait }

この2つでiPadでDevice OrientationをPortraitのみにする事ができました。

参考にした記事

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2