LoginSignup
0
2

More than 3 years have passed since last update.

Xcode11でiPadの画面回転設定を行う

Last updated at Posted at 2019-12-18

iOSアプリを新たに横画面に対応させようとした時にハマったのでメモ。

問題点

通常、画面回転を行いたい場合はTargetのGeneralタブの「Device Orientation」部分のチェックボックスで設定を行うのだが、ここでの設定変更はiPadでは反映されない。(特にエラーメッセージも出ないので、ユーザーのレビューで指摘されるまで気付けなかった…)

スクリーンショット 2019-12-18 11.01.04.png

解決策

Info.plist を直接編集する。

    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        //ここに追記
    </array>

終わりに

Info.plistが自動で追記されないのは仕様なのか不具合なのか…?

自分の見落としがあるかもしれないので、もっと簡単な解決方法があればコメントで教えていただけると助かります。

0
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
0
2